I need help with the format for single qoutes. I am using dynamic sql in an SSRS for error trapping records inserted with single qoutes during bulk imports but I cannot seem to format the actual select statement properly.
SQL Sever 2005 Dev edition. Any help is great.
Declare @DB varchar(99) ------------not used in actual report only for testing in ssms
Set @DB = 'TestDb1' ------------not used in actual report only for testing in ssms
declare @sqlstring nvarchar (3000)
set @sqlstring = 'use ' + @DB + '(select * from Address where Customer like ''%''%'')'
execute sp_executesql @sqlstring