Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Other SQL Server Topics (2005)
 Increase the size of varchar type

Author  Topic 

Dash
Starting Member

3 Posts

Posted - 2009-03-04 : 06:02:03
How can I increase the size of varchar more than 8000. I need at least 10,000 length. So is there any procedure available to increase the varchar or there is any other datatype available which will allow the size something more than 8000.


For any help, thanks in advance.


Regards
~ riti

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2009-03-04 : 07:03:22
SQL Server supports varchar(max) which is well enough to have 2^31-1 bytes

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

Dash
Starting Member

3 Posts

Posted - 2009-03-04 : 10:46:04
hello Madhivanan,

Thanks for your response. But i needed something more than that.
But no worry, as i found the solution now.

SOLUTION: If we need a variable something like size of 15000 or more than that, then in that case as SQL Server allows us to take only max of varchar(8000) only, So we need to take 2 variables simultaneously with varchar(8000) each. And assign 50% to the 1st variable & another 50% to the 2nd variable. And at the end just append two variables. Here you will get the solution. CHEERS


Regards
~ riti
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2009-03-05 : 01:49:52
quote:
Originally posted by Dash

hello Madhivanan,

Thanks for your response. But i needed something more than that.
But no worry, as i found the solution now.

SOLUTION: If we need a variable something like size of 15000 or more than that, then in that case as SQL Server allows us to take only max of varchar(8000) only, So we need to take 2 variables simultaneously with varchar(8000) each. And assign 50% to the 1st variable & another 50% to the 2nd variable. And at the end just append two variables. Here you will get the solution. CHEERS


Regards
~ riti


Are you using SQL Server 2005?

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

Dash
Starting Member

3 Posts

Posted - 2009-03-05 : 05:27:34
yes
Go to Top of Page
   

- Advertisement -