Click here to Skip to main content
15,886,724 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hey Friends,
i used varchar(max) datatype in table but still it is small to store my string plz suggest me bigger size datatype. thank you.
my string is as follows:

"X RAY LEFT HIP WITH THIGH AP/LAT --ACCEPTABLE WITH IMPLANT IN SITU WITH ACETABULAR CUP ARTHRITIC CHANGES    2 D ECHO-MILD CONC LVH                  GOOD LV DIASTOLIC FUNCTION                    ALTERED LV DIASTOLIC FUNCTION LVEF 55 %  MRI BRAIN- FEW OLD ISCHEMIC CHNGES IN BILATERAL CEREBRAL WHITE MATTER    MRI L-S SPINE WITH SCREENING OF WHOLE SPINE- PID-L3-4,L5-S1  PID C3- 4TO C6-7  "
Posted
Updated 22-Apr-15 21:03pm
v2
Comments
Sascha Lefèvre 23-Apr-15 2:45am    
Which database are you talking about? SQL Server stores up to 2GB in a varchar(max) column. So that can't be the issue.

Your string is having length = 341
varchar(max) can store upto 8000 chars.

Alternative way is to use nvarchar(max).

https://msdn.microsoft.com/en-us/library/ms176089.aspx[^]
Hope this helps.
-Bhavik Chaudhari
 
Share this answer
 
v2
Your question is not very clear.
There are only three types of string types - char , text and varchar.
Both text and varchar support date lengths upto 2GB.

Nvarchar and ntext are used only for storing unicode characters.
As per documentation[^], text and ntext will be removed in a future release.

There is another type called sql_variant that can store values of various data types.
 
Share this answer
 
Comments
Member 11543226 23-Apr-15 3:23am    
can sql_variant able to store above string? i tried with varchar(max) and nvarchar(max) both faild.
Abhinav S 23-Apr-15 4:18am    
Check the error again. It may not have anything to do with the size of the data.
Member 11543226 23-Apr-15 6:00am    
i found the original problem this string is enclosed in double quotes and contain 1 quamma also. thats the issue plz give me sugessiton to solve it.
Member 11543226 23-Apr-15 6:54am    
it works thanks. but the original problem is different.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900