Hi,i was meaning to write this for quite a long time.in following case i was using bulk export to file:declare @file varchar(50)declare @cmd varchar(2000)set @file = 'C:\adventureWorks_emails'set @cmd = 'bcp "select EmailAddress from Person.Contact where ContactID between 10 and 15" queryout "' SET @cmd = @cmd + @file + '" -t -T -c'exec master..xp_cmdshell @cmd
if i would be using in select statement string selection, query would report error, eg.:..select EmailAddress from Person.Contact where EmailAddress like '%@ad%'..
due to single quote. any solutions?