PRINTing problem

Hi

I write following code in SQL server 2005

DECLARE @ttvarchar(20)

DECLARE @uuvarchar(20)

SET @uu='variable'

PRINT'This is printed'

PRINT'This is not printed'+ @tt+'This is not printed'

PRINT'This is printed '+ @uu+' This is printed '

OUTPUT:

This is printed

This is printed variable This is printed

Why the Second print command don’t print

(I know @tt variable is not initialized, if I initialized @tt variable then every thing is fine)

WHY?

Regards,

Thanks.

Gurpreet S. Gill

[3742 byte] By [GurpreetSinghGill] at [2007-12-22]
# 1

string concatenates with null yields null by default. You can force null to be an empty string by turning CONCAT_NULL_YIELDS_NULL off

e.g.
set concat_null_yields_null off

oj at 2007-8-30 > top of Msdn Tech,SQL Server,SQL Server Database Engine...
# 2

Thanksssssssss man..... Problem solved.

Regards,

Thanks

Gurpreet S. Gill

GurpreetSinghGill at 2007-8-30 > top of Msdn Tech,SQL Server,SQL Server Database Engine...

SQL Server

Site Classified