Groups | Blog | Home
all groups > sql server programming > may 2004 >

sql server programming : '' vs ' '



Jeff Duncan
5/3/2004 11:47:44 AM
you could use ltrim and isnull to assure your value.

--
Jeff Duncan
MCDBA, MCSE+I
[quoted text, click to view]

Dan Guzman
5/3/2004 7:38:52 PM
[quoted text, click to view]

If your database compatibility level is 70 or 80, an empty string (length
zero) is considered equal to a string containing zero or more spaces.

--
Hope this helps.

Dan Guzman
SQL Server MVP

[quoted text, click to view]

toylet
5/3/2004 11:26:42 PM
Is it safe to assume that an empty string (which contains any number of
space characters) is always equal to ''? Or should I go for
ltrim(rtrim(@string))=0?

--
.~. Might, Courage, Vision. In Linux We Trust.
/ v \ http://www.linux-sxs.org
/( _ )\ Linux 2.4.26
AddThis Social Bookmark Button