In SQL 2005 variable assignment is done by:
DECLARE @CurrentDate_in_2005 DATETIME
SET @CurrentDate_in_2005 = GETDATE()
SELECT @CurrentDate_in_2005 AS CurrentDate_in_2005
But in SQL Server 2008 we can do it in one line:
DECLARE @CurrentDate_in_2008 DATETIME = GETDATE()
SELECT @CurrentDate_in_2008 AS CurrentDate_in_2008
DECLARE @CurrentDate_in_2005 DATETIME
SET @CurrentDate_in_2005 = GETDATE()
SELECT @CurrentDate_in_2005 AS CurrentDate_in_2005
But in SQL Server 2008 we can do it in one line:
DECLARE @CurrentDate_in_2008 DATETIME = GETDATE()
SELECT @CurrentDate_in_2008 AS CurrentDate_in_2008
No comments:
Post a Comment