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
 SQL Server 2005 Forums
 SQL Server Administration (2005)
 Using base-2 number system for varchars

Author  Topic 

2ton
Starting Member

1 Post

Posted - 2008-07-18 : 09:33:28
Hello,
For some time I have been using base-2 numbers when creating varchars in SQL Server. For example varchar(8), varchar(1024) or varchar(2048) where as most people i work with would just create their varchars with more rounded numbers for example varchar(10), varchar(1000) or varchar(2000).

I think I was told years ago that it was good practice to use base-2 when specifying varchars as it made better use of memory etc. Since then I've just really done it out of habit. What I really want to know is does it really make any difference? Anyone else specify their varchars like this?

Thanks

elancaster
A very urgent SQL Yakette

1208 Posts

Posted - 2008-07-18 : 09:35:49
i've never heard of that?? i make a decision on length dependant on business requirement

Em
Go to Top of Page

sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2008-07-18 : 09:38:25
quote:
Originally posted by elancaster

i've never heard of that?? i make a decision on length dependant on business requirement

Em



Exactly.
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2008-07-18 : 10:10:04
And some consideration to record size vs page size.


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

rmiao
Master Smack Fu Yak Hacker

7266 Posts

Posted - 2008-07-19 : 01:03:10
>> What I really want to know is does it really make any difference?

Does store 500 charecters in varchar(1024) different from in varchar(1000)? No difference.
Go to Top of Page
   

- Advertisement -