I do not understand why the following gives me an error. I thought this was due to the comment, but @SQL is nvarchar (4000).
BEGIN sp_executesql N'SELECT ''td''' --sp_executesql @SQL, N'@StartDate DateTime, @EndDate DateTime, @End2 DateTime, @Program varchar(4)', @StartDate, @EndDate, @End2, @Program END
sql tsql sql-server-2005 dynamic-sql
OMG Ponies
source share