I'm running the below script to test something but it seems it's not working. Is there a setting I need to turn on/off?
DECLARE @date datetime
DECLARE @dailyEnd varchar(12)
DECLARE @column varchar(100)
SET @date = '02 Jan 2012'
SET @dailyEnd = @date + 1
SET @column = 'D'+Convert(varchar(8), @date, 12)
print @date
print @dailyEnd
print @column
I don't see the values returned on screen, but only this message:
Command(s) completed successfully.
You're using SQL Server Management Studio, right? There are 2 tabs of output:
Or, you may have set your query options to Parse Only. (Right-click your SQL and select Query Options.)