Wednesday, February 13, 2008

SQL Server 2008 - Declaration and initialization of Variable

I would say one of the simple but genuine enhancement in 2008 is Declaration and initialization of variable in the same step. Something like this

Declare @Variable Varchar(10) =’Madhu’.

Earlier vrsion we had to do this in two steps.

Declare @Variable Varchar(10)
Set @Variable=’Madhu’ OR Select @Variable=’Madhu’

Small but very effective

No comments: