BoulderBum
Programmer
Is it possible to build a SQL string within SQL Server, then execute it only once at the end of proc?
E.G. Can I do something like:
SqlString = 'SELECT * FROM table'
IF NOT @filter IS NULL
SqlString = SqlString + ' WHERE filter = ' + @filter
//Run query according to SqlString
E.G. Can I do something like:
SqlString = 'SELECT * FROM table'
IF NOT @filter IS NULL
SqlString = SqlString + ' WHERE filter = ' + @filter
//Run query according to SqlString