SyntaxFix
Write A Post
Hire A Developer
Questions
Use exec sp_execsql @Sql
exec sp_execsql @Sql
Example
DECLARE @sql as nvarchar(100) DECLARE @paraDOB datetime SET @paraDOB = '1/1/1981' SET @sql=N'SELECT * FROM EmpMast WHERE DOB >= @paraDOB' exec sp_executesql @sql,N'@paraDOB datetime',@paraDOB