Showing posts with label format. Show all posts
Showing posts with label format. Show all posts

Wednesday, March 28, 2012

Kinda new to SQL, have a few questions

I have to update my database format to msSQL (any version) and the specific version I will be using I guess is unknown.

1. Security wise is there anything I should have installed? Can databases be accessed remotely through anything other than serverside scripts or software?
2. Backups will be important and so does msSQL allow you to do this easily? Is there a function in the program that will allow automatic backups? Or, I have autobackup software that basically zips files, would this work for msSQL?

Will probably think of some more questions :P

Thanks a lotIn answer to your second question (2) : Yes MSSQL allows scheduled backups from within the management studio interface. You can set up a scheduled job and get it to run on a daily basis. You need to set up a backup device (file area). Usually advisable to have a seperate drive for this (although a partition MIGHT suffice, except in disk failure scenarios).|||Thanks, when you say a separate drive is this due to performance or loss of data due to disk failure etc?
Is this a feature of all versions?

Thanks again|||ummmmm....do you have sql server client tools installed?

Start there, then get back to us

If you don't have access to a sql server or the tools, this will be very difficult to help you|||This was just general research before I go out and buy anything expensive|||Depending upon your requirements you could start with SQL Server Express, which is very cheap (free, I think).|||yes, it's free. has similar limitations as MSDE, like no more than 4gb database size, etc.|||Ok then thanks, did not know there was a free version.
What else should I add to my checklist of things to install?

sql server client tools?|||there is a free client to go along with the free server. client is SQL Server Management Studio Express, server is SQL Server Express.

you can get both here: http://msdn.microsoft.com/vstudio/express/sql/download/

Monday, March 12, 2012

Key portion of datetime 'UniqueName' varies between Trees

I have 2 trees that use the attribute Calendar date.

In the first tree, the unique name is in this format:

..[2004-02-08T00:00:00]

in the second, it does not have the T:

..[2004-02-08 00:00:00]

I guess I'm wondering why this is happening and also, how to make it so that both trees have the same format. It wasn't always this way, but something might have changed with the cube definition - I just can't see anything that would cause this. It's currently causing an issue in reporting because I convert between the tree types by slapping on the key portion of the UniqueName to the tree name. Having the T or absence of a T causes issues in this transformation.

This was found to be caused by relationship changes between attributes of one of the hierarchies.

Friday, March 9, 2012

Keeping text format after stored in the data base.

I want the users of my site to be able to write a couple of paragraphs, save it to SQL Server and then have it read back and look the same. I don't want the users to be able to add any html to the text they submit. I just want them to be able to seperate or indent their paragraphs.

At one point, I had a textbox that saved text to the server and read it back the same way it was originally inputed. However, I can't figure our what I had done to make it work.

Any ideas?
ThanksIt's usually an issue between cariage return and line feed characters and <br> tags. Depending on where/how you're displaying the text, you probably have to replace one with the other.|||For those that are interested.
I figured out that I can look at the ASCII value of each Char in the string then use a switch statement
public string FormatText(string textBlock)
{
//return textBlock;4444
string formattedText = "";
int charCount = 0;
foreach(char x in textBlock)
{
charCount++;
switch((int)x)
{
case 10:
charCount = 0;
formattedText += "<br>";
break;
case 32:
if(charCount > 60)
{
formattedText += "<br>";
charCount = 0;
}
else
formattedText += " ";
break;
default:
formattedText += x;
break;
}
}
return formattedText;
}

Keeping Sections together

I have a problem with the details of the report for a record going to the second page. I have set the format option in the report "Keep sections together". But still the data for the report goes to the second page.

What else has to be done for the report to be proper? Please let me know on this.
I have tried out the option of setting it through the code as well by the code

"CR1.sectionformat(0) = "DETAIL;X;X;X;T;X;X;X"Hi
what is the size of the record? If it is of large size having many characters you may face this problem

Madhivanan|||It is a Group by report and i want the records for the particular group to be on the same page and it should not go to the next page. what are the other possibilities which i can try out. I am using CR 4.6

Help|||in the grey area of your group right click - select "change group" and check the "keep group together" option

Keeping same DateTime format and others in production server

Hi,

I noticed that some of my Stored Procedure is not working well on the production server cause it seems that it has not the same DateTime format...(amongst other things ).

Example of differences between DateTime format :
----------------------
My station (SQL Express 2005) : 26/06/2007 3:17:20 PM
Production server (SQL 2005 Enteprise) : 2007-06-26 15:17:20

How can i make the format of the database unchangeable so it keep the same format on the production server?

I use SQL Express 2005 for coding and SQL 2005 Enteprise for production.

Thanks

check the region settings in the production server's OS and make them the same

|||

Ok nice it works.

But if i had no access to the production server (if i host my web site on godaddy for example), what else can we do?

|||

That's a good question that I can't answer - you might contact them and see if they have any servers running on the same format as yours, so that they could transfer your domain there...other than that - I have no idea.

|||

http://msdn2.microsoft.com/en-us/library/ms142797.aspx

You can set the language in your connect string. Alternatively, you can issue the SET LANGUAGE / SET DATEFORMAT explicitly yourself before your SQL commands.

Although ultimately, that is telling me that you are treating your datetime's as strings (and/or using string concatenation instead of parameterized queries). Both of those are bad practices, should be changed, and then you wouldn't care about the server's language either.

|||

Hi,

Ok i understand.

I use :

.....@.DateFinale varchar(30), ...

select @.stmt = 'SELECT *
FROM Categories
WHERE CategoryID =' + @.CategoryID + ' AND DateOnCreate >=''' + @.DateFinale + ''' ORDER BY DateOnCreate DESC'

What will be the code above if i change the type of @.DateFinale for @.DateFinale DateTime?

Thanks for your help.