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

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Values getting cut off

Author  Topic 

Starting Member

29 Posts

Posted - 2005-01-24 : 14:03:05

It was the default setting I needed to change.


22859 Posts

Posted - 2005-01-24 : 14:11:54
I don't image it has anything to do with your problem, but given that you are working with both varchar and Nvarchar should you be using DATALENGTH() instead of LEN() ??

Or do they behave the same (I thought that for Nvarchar DATALENGTH() was required/preferred - but maybe I'm thinking from the wrong end!)

Go to Top of Page

Cybernetic Yak Master

11752 Posts

Posted - 2005-01-24 : 14:44:20
declare @a varchar(10)
declare @b nvarchar(10)
select @a = '12345', @b = '12345'

select len(@a) as [len A], datalength(@a) as [datalength A],
len(@b) as [len B], datalength(@b) as [datalength B]

len A datalength A len B datalength B
----------- ------------ ----------- ------------
5 5 5 10

Go with the flow & have fun! Else fight the flow
Go to Top of Page

- Advertisement -