varchar(max) in database - how to put the size in ADO.NET
-
Hi, I have field in database and it is defined as Varchar(max). And in the front in ADO.NET I am trying with the options AddParamToSQLCmd(sqlCmd, "@Comments", SqlDbType.VarChar, -1, ParameterDirection.Input, pArg.Comments); SqlDbType.NVarChar, -1 SqlDbType.VarChar, -1 SqlDbType.NText, -1 and nothing seemed working. I am trying to insert over some 48000 charecters but it is storing only 43500 some charecters. Not sure if I am missing some thing. Am I doing it right or can some one please help me how to get around this issue. Thanks in advance L
-
Hi, I have field in database and it is defined as Varchar(max). And in the front in ADO.NET I am trying with the options AddParamToSQLCmd(sqlCmd, "@Comments", SqlDbType.VarChar, -1, ParameterDirection.Input, pArg.Comments); SqlDbType.NVarChar, -1 SqlDbType.VarChar, -1 SqlDbType.NText, -1 and nothing seemed working. I am trying to insert over some 48000 charecters but it is storing only 43500 some charecters. Not sure if I am missing some thing. Am I doing it right or can some one please help me how to get around this issue. Thanks in advance L
Varchar max is 8000, Nvarchar is 4000. If you need more than that use text. http://msdn.microsoft.com/en-us/library/ms176089.aspx[^] http://msdn.microsoft.com/en-us/library/ms186939.aspx[^]
Need custom software developed? I do custom programming based primarily on MS tools with an emphasis on C# development and consulting. I also do Android Programming as I find it a refreshing break from the MS. "And they, since they Were not the one dead, turned to their affairs" -- Robert Frost
-
Varchar max is 8000, Nvarchar is 4000. If you need more than that use text. http://msdn.microsoft.com/en-us/library/ms176089.aspx[^] http://msdn.microsoft.com/en-us/library/ms186939.aspx[^]
Need custom software developed? I do custom programming based primarily on MS tools with an emphasis on C# development and consulting. I also do Android Programming as I find it a refreshing break from the MS. "And they, since they Were not the one dead, turned to their affairs" -- Robert Frost
I tried with the Text but the same thing it can't store more than 43567 charecters. I also tried updating the Text database field that I just created for testing in the management studio but no luck. For some unknown reason it is storing only 43567 charecteros of text. Any inputs towards fixing this issue is greatly appreciated. Thanks, L
-
Varchar max is 8000, Nvarchar is 4000. If you need more than that use text. http://msdn.microsoft.com/en-us/library/ms176089.aspx[^] http://msdn.microsoft.com/en-us/library/ms186939.aspx[^]
Need custom software developed? I do custom programming based primarily on MS tools with an emphasis on C# development and consulting. I also do Android Programming as I find it a refreshing break from the MS. "And they, since they Were not the one dead, turned to their affairs" -- Robert Frost
-
Hi, I have field in database and it is defined as Varchar(max). And in the front in ADO.NET I am trying with the options AddParamToSQLCmd(sqlCmd, "@Comments", SqlDbType.VarChar, -1, ParameterDirection.Input, pArg.Comments); SqlDbType.NVarChar, -1 SqlDbType.VarChar, -1 SqlDbType.NText, -1 and nothing seemed working. I am trying to insert over some 48000 charecters but it is storing only 43500 some charecters. Not sure if I am missing some thing. Am I doing it right or can some one please help me how to get around this issue. Thanks in advance L
-
Ennis Ray Lynch, Jr. wrote:
Varchar max is 8000, Nvarchar is 4000. If you need more than that use text.
Both of those links specifically mention 'varchar(max)' which takes 2 gigs. And the OP is already successfully storing more than 8000 as well.
Huh, never actually noticed. I could have sworn MAX was a synonym for 4000 and 8000 respectively. Learn something new everyday.
Need custom software developed? I do custom programming based primarily on MS tools with an emphasis on C# development and consulting. I also do Android Programming as I find it a refreshing break from the MS. "And they, since they Were not the one dead, turned to their affairs" -- Robert Frost
-
Varchar max is 8000, Nvarchar is 4000. If you need more than that use text. http://msdn.microsoft.com/en-us/library/ms176089.aspx[^] http://msdn.microsoft.com/en-us/library/ms186939.aspx[^]
Need custom software developed? I do custom programming based primarily on MS tools with an emphasis on C# development and consulting. I also do Android Programming as I find it a refreshing break from the MS. "And they, since they Were not the one dead, turned to their affairs" -- Robert Frost
Good one.