Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 DataType storing strings of variable length ?

Author  Topic 

fabianus76
Posting Yak Master

191 Posts

Posted - 2007-08-22 : 12:13:45
Hello guys!

I am looking for the best DataType that makes it possible to store strings of variable length (from 15 to 300 caracters, rarely longer).


Thanks a lot for any help !

Regards,
Fabianus

my favorit hoster is ASPnix : www.aspnix.com !

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2007-08-22 : 12:22:37
This was a though one, until I found the answer in Books Online.
The answer is VARCHAR(400).



E 12°55'05.25"
N 56°04'39.16"
Go to Top of Page

fabianus76
Posting Yak Master

191 Posts

Posted - 2007-08-22 : 12:27:36
Hi Peso,

thanks for your help!
Does it mean that if I define VARCHAR(400) and a field gets "ABC" it won't take the space of 400 caracters in the db?

Thanks for some further advice.

Yours,
Fabian

my favorit hoster is ASPnix : www.aspnix.com !
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2007-08-22 : 12:29:03
Why don't YOU look inside Books Online this time?



E 12°55'05.25"
N 56°04'39.16"
Go to Top of Page
   

- Advertisement -