[dba-SQLServer] varchar limits

Stuart McLachlan stuart at lexacorp.com.pg
Mon May 24 19:18:25 CDT 2004


On 25 May 2004 at 10:59, David Emerson wrote:

> SQL2000.
> 
> I have the following declaration in a stored procedure -
> 
>          declare @qs varchar(8000)
> 
> However, when I assign a string to the variable it seems to truncate at 
> 4000 characters.  My understanding is that varchar can have up to 8000 
> characters.  Is there something I am missing?
> 

Where are you passing the string from? Is the string unicode (which 
users two bytes per character)? If so, you may be getting an implicit 
conversion to nvarchar.



 
-- 
Lexacorp Ltd
http://www.lexacorp.com.pg
Information Technology Consultancy, Software Development,System 
Support.






More information about the dba-SQLServer mailing list