dbTalk Databases Forums  

Varchar(MAX)

comp.databases.ms-sqlserver comp.databases.ms-sqlserver


Discuss Varchar(MAX) in the comp.databases.ms-sqlserver forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Phil Hunt
 
Posts: n/a

Default Varchar(MAX) - 10-07-2010 , 04:33 PM






Can someone tell me how much data can I store in a colume defined as
Varchar(max). I am using SQL 2008.

Thanks

Reply With Quote
  #2  
Old   
Hugo Kornelis
 
Posts: n/a

Default Re: Varchar(MAX) - 10-08-2010 , 01:51 AM






On Thu, 7 Oct 2010 17:33:19 -0400, Phil Hunt wrote:

Quote:
Can someone tell me how much data can I store in a colume defined as
Varchar(max). I am using SQL 2008.

Thanks

Hi Phil,

The maximum storage size for all ...(max) data type is 2^31-1 bytes. And
since varchar uses 1 byte for each character, that works out to 2^31-1
characters. Or, in decimal form, 2,147,483,647 characters.

--
Hugo Kornelis, SQL Server MVP
My SQL Server blog: http://sqlblog.com/blogs/hugo_kornelis

Reply With Quote
  #3  
Old   
Phil Hunt
 
Posts: n/a

Default Re: Varchar(MAX) - 10-08-2010 , 09:37 AM



Thanks. That's what I thought. But when I tried to store an huge xml (around
16 m) in the varchar(max), nothing is stored. And no error was raised, do
you know why ?

"Hugo Kornelis" <hugo (AT) perFact (DOT) REMOVETHIS.info.INVALID> wrote

Quote:
On Thu, 7 Oct 2010 17:33:19 -0400, Phil Hunt wrote:

Can someone tell me how much data can I store in a colume defined as
Varchar(max). I am using SQL 2008.

Thanks


Hi Phil,

The maximum storage size for all ...(max) data type is 2^31-1 bytes. And
since varchar uses 1 byte for each character, that works out to 2^31-1
characters. Or, in decimal form, 2,147,483,647 characters.

--
Hugo Kornelis, SQL Server MVP
My SQL Server blog: http://sqlblog.com/blogs/hugo_kornelis

Reply With Quote
  #4  
Old   
Phil Hunt
 
Posts: n/a

Default Re: Varchar(MAX) - 10-08-2010 , 03:30 PM



I got it. IT stored, the studio does not show it, stupid


"Phil Hunt" <aaa (AT) aaa (DOT) com> wrote

Quote:
Thanks. That's what I thought. But when I tried to store an huge xml
(around 16 m) in the varchar(max), nothing is stored. And no error was
raised, do you know why ?

"Hugo Kornelis" <hugo (AT) perFact (DOT) REMOVETHIS.info.INVALID> wrote in message
news:dpfta691do0diebmiste68up03gts9q1cp (AT) 4ax (DOT) com...
On Thu, 7 Oct 2010 17:33:19 -0400, Phil Hunt wrote:

Can someone tell me how much data can I store in a colume defined as
Varchar(max). I am using SQL 2008.

Thanks


Hi Phil,

The maximum storage size for all ...(max) data type is 2^31-1 bytes. And
since varchar uses 1 byte for each character, that works out to 2^31-1
characters. Or, in decimal form, 2,147,483,647 characters.

--
Hugo Kornelis, SQL Server MVP
My SQL Server blog: http://sqlblog.com/blogs/hugo_kornelis


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.