Congratulations to all the winners of April 2013, they have won INR 3400 cash and INR 20147 worth prizes !
DotNetFunda.Com Logo
Twitter TwitterLinkedIn
YouTubeGoogle
 Online : 10875 |  Welcome, Guest!   Register  Login
 Home > Forums > Sql Server > varchar datatype - difference in max and 8000 ...
Nagasundar_Tn

varchar datatype - difference in max and 8000

Replies: 3 | Posted by: Nagasundar_Tn on 9/22/2012 | Category: Sql Server Forums | Views: 290 | Status: [Member] | Points: 10  


Hi Experts,

I have a basic doubt in SQL Server 2005. If we declare a column with varchar(8000) then we can insert upto 8000 characters into that column. If we declare varchar(max) then we can insert upto (2 ^ 31)-1 characters into that column.

My doubt is why we are unable to declare varchar(8001) onwards. varchar datatype supports upto 2^31-1 characters but unable to give varchar(8001).


Pls forgive me for this silly question...

Regards,
T.N.Nagasundar


Reply | Reply with attachment | Alert Moderator

 Responses below this adGet hundreds of .NET Tips and Tricks videos

 Replies

Jayakumars
Jayakumars  
Posted on: 9/22/2012 5:53:24 AM
Level: Bronze | Status: [Member] | Points: 25

hi

sql sever 2005 design datatype may be
varchar(8000) if u need varchar(8000)> then use put max after brackets


Mark as Answer if its helpful to you

Regards
Email Id: kumaraspcode2009@gmail.com

Nagasundar_Tn, if this helps please login to Mark As Answer. | Reply | Alert Moderator 

Nagasundar_Tn
Nagasundar_Tn  
Posted on: 9/22/2012 6:13:58 AM
Level: Starter | Status: [Member] | Points: 25

Hi

Thanks for you response. But my doubt is since varchar supports upto 2 GB of data why I am unable to define varchar(8001). Are there any constraint on it? Pls help me in detail

Regards,
T.N.Nagasundar

Nagasundar_Tn, if this helps please login to Mark As Answer. | Reply | Alert Moderator 

Jayakumars
Jayakumars  
Posted on: 9/22/2012 6:17:16 AM
Level: Bronze | Status: [Member] | Points: 25

hi

yes if u can use varchar(max) this is allow large data then move to sql server 2008 also there allow large

Please mark as answer if it helpful to you.

Mark as Answer if its helpful to you

Regards
Email Id: kumaraspcode2009@gmail.com

Nagasundar_Tn, if this helps please login to Mark As Answer. | Reply | Alert Moderator 

Reply - Please login to reply


Click here to login & reply

About Us | Contact Us | The Team | Advertise | Software Development | Write for us | Testimonials | Privacy Policy | Terms of Use | Link Exchange | Members | Go Top
General Notice: If you find plagiarised (copied) contents on this page, please let us know the original source along with your correct email id (to communicate) for further action.
Copyright © DotNetFunda.Com. All Rights Reserved. Copying or mimicking the site design and layout is prohibited. Logos, company names used here if any are only for reference purposes and they may be respective owner's right or trademarks. | 5/19/2013 6:42:24 AM