Trying to build a rather large SQL statement dynamically.
How do you embedd the data with single quotes whithin a string. Thanks
Here is a snip..
Declare @Sql varchar(100)
Declare @Monday char(1)
Set @Monday='T'
Set @SQL='Declare Csr as Cursor For Select * from ABC'
***@Monday needs quotes
Set @sWhere2=@sWhere2+' Monday='+@Monday
Set @SQL=@SQL + ' Where ' +@sWhere + @sWhere2
How do you embedd the data with single quotes whithin a string. Thanks
Here is a snip..
Declare @Sql varchar(100)
Declare @Monday char(1)
Set @Monday='T'
Set @SQL='Declare Csr as Cursor For Select * from ABC'
***@Monday needs quotes
Set @sWhere2=@sWhere2+' Monday='+@Monday
Set @SQL=@SQL + ' Where ' +@sWhere + @sWhere2