Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I recently discovered that MS-SQL Server 2008 imposes an upper limit of 8000 bytes for a column (for character data).
I need to store data that occusionally could surpass this limit.
Is there a way to do this?
The data are character strings.

Thanks

share|improve this question

1 Answer 1

up vote 2 down vote accepted

Use varchar(max) or nvarchar(max). These have a storage limit of 2^31-1 bytes.

share|improve this answer
    
@squillman:But here msdn.microsoft.com/en-us/library/ms143432.aspx does not make such a distinction. –  user76678 May 23 '11 at 19:58
1  
@user76678 Yes it does. On that page see the lines that say Bytes per varchar(max), varbinary(max), xml, text, or image column and Characters per ntext or nvarchar(max) column under Database Engine objects. –  squillman May 23 '11 at 20:03
    
@squillman:May be it is my missunderstanding;what is the difference with Bytes per short string column? –  user76678 May 23 '11 at 20:04
    
@user76678 Also, are you using SQL Server 2008 or SQL Server 2008 R2? Whereas this particular item is not different between the two, they are different versions. –  squillman May 23 '11 at 20:05
    
@user76678 Bytes per short string is for the non max flavor of varchar and nvarchar. That is, (n)varchar can go up to 8000 characters (ie- varchar(8000) / nvarchar(8000)) When you use (n)varchar(max) that changes the game. –  squillman May 23 '11 at 20:12

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.