Hi,
Let's say I have this link and want to insert it into a field. What is the right way to escape/replace those single quote double quote characters so the insert will work, and when it is retrieved, the original syntax is preserved?
So here is the string:
<a href="http://www.oursite.org/page1/pageX/download.php?fileinfo=VeryLong9rcy9iVldmFsbLnBkZg==§iondetailid=123456"" target="_blank"
onclick="window.open('http://www.anothersite.com/page/download.php?fileinfo=AnotherLongmlsZTIxN5wZGY=§iondetailid=98765','_newPage','toolbar=1,resizable=1');">Additonal InformationBy clicking yes, I approved XYZ
if object_ID('tempdb..#dummyURL') is not null drop table dummyURL;
create table #dummyURL (URL_LINK nvarchar(1000))
--this(=just added ' ') wouldn't work.
insert into #dummyURL (URL_LINK)
Select
'<a href="http://www.oursite.org/page1/pageX/download.php?fileinfo=VeryLong9rcy9iVldmFsbLnBkZg==§iondetailid=123456"" target="_blank"
onclick="window.open('http://www.anothersite.com/page/download.php?fileinfo=AnotherLongmlsZTIxN5wZGY=§iondetailid=98765','_newPage','toolbar=1,resizable=1');">Additonal InformationBy clicking yes, I approved XYZ.'
--but this next worked (after replaced " with " and ' with ':)
insert into #dummyURL (URL_LINK)
Select
'<a href="http://www.oursite.org/page1/pageX/download.php?fileinfo=VeryLong9rcy9iVldmFsbLnBkZg==§iondetailid=123456"" target="_blank"
onclick="window.open('http://www.anothersite.com/page/download.php?fileinfo=AnotherLongmlsZTIxN5wZGY=§iondetailid=98765','_newPage','toolbar=1,resizable=1');">Additonal Information
By clicking yes, I approved XYZ.'
drop table #dummyURL
--but since I don't have a way to validate the returned value, I have to ask.
Thanks!