Cannot paste my text into column

davearia

Well-known member
Joined
Jan 4, 2005
Messages
184
Hi All,

Im have a strange situation with SQL Server 2000. I am trying to paste this into a VARCHAR (8000):
<asp:panel id=pnlFlashBanner style=Z-INDEX: 104; LEFT: 288px; POSITION: absolute; TOP: 312pxrunat=server Height=112px Width=632px><OBJECT codeBase=http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0height=100 width=600 classid=clsid:D27CDB6E-AE6D-11cf-96B8-444553540000 VIEWASTEXT><PARAM NAME=_cx VALUE=15875><PARAM NAME=_cy VALUE=2646><PARAM NAME=FlashVars VALUE=><PARAM NAME=Movie VALUE=MEB_Banner.swf><PARAM NAME=Src VALUE=MEB_Banner.swf><PARAM NAME=WMode VALUE=Window><PARAM NAME=Play VALUE=-1><PARAM NAME=Loop VALUE=-1><PARAM NAME=Quality VALUE=High><PARAM NAME=SAlign VALUE=><PARAM NAME=Menu VALUE=-1><PARAM NAME=Base VALUE=><PARAM NAME=AllowScriptAccess VALUE=always><PARAM NAME=Scale VALUE=ShowAll><PARAM NAME=DeviceFont VALUE=0><PARAM NAME=EmbedMovie VALUE=0><PARAM NAME=BGColor VALUE=><PARAM NAME=SWRemote VALUE=><PARAM NAME=MovieData VALUE=><PARAM NAME=SeamlessTabbing VALUE=1><embed src=MEB_Banner.swf quality=high pluginspage=http://www.macromedia.com/go/getflashplayertype=application/x-shockwave-flash width=600 height=100></embed></OBJECT></asp:panel>
Admittedly this is a long piece of text but running a little letter count application I know that it is only 1211 characters long.

However when I paste the above text into SQL Server I get this warning:

"The value you entered not consistent with the data type or length of the column."

I read on the web a little and discovered that somebody had this problem and they had used NVARCHAR instead which fixed it for them, this has not worked for myself though.

Does anyone have any idea what SQL is objecting to?

Thanks, Dave.
 
Is this in query analyzer or using ado.net?
Try using a parameterized query if ADO.NET.
Try executing something like this. . .


Code:
[b]SET QUOTED_IDENTIFIER OFF;[/b]
update mytable set myhtml = [b]"[/b]<asp:panel id=pnlFlashBanner[b]"[/b] +
[b]"[/b]style=Z-INDEX: 104; LEFT: 288px; POSITION: absolute; [b]"[/b] +
[b]"[/b]TOP: 312pxrunat=server Height=112px Width=632px>[b]"[/b] +
[b]"[/b]<OBJECT codeBase=http://download.macromedia.com/pub/[b]"[/b] +
[b]"[/b]shockwave/cabs/flash/swflash.cab#version=6,0,29,0 [b]"[/b] +
[b]"[/b]height=100 width=600 classid=clsid:D27CDB6E-AE6D-11cf-96B8-[b]"[/b] +
[b]"[/b]444553540000 VIEWASTEXT><PARAM NAME=_cx VALUE=15875>[b]"[/b] +
[b]"[/b]<PARAM NAME=_cy VALUE=2646><PARAM NAME=FlashVars[b]"[/b] +
[b]"[/b] VALUE=><PARAM NAME=Movie VALUE=MEB_Banner.swf><PARAM[b]"[/b] +
[b]"[/b] NAME=Src VALUE=MEB_Banner.swf><PARAM NAME=WMode [b]"[/b] +
[b]" [/b]VALUE=Window><PARAM NAME=Play VALUE=-1><PARAM NAME=[b]"[/b] +
[b]"[/b]Loop VALUE=-1><PARAM NAME=Quality VALUE=High><PARAM [b]"[/b] +
[b]"[/b]NAME=SAlign VALUE=><PARAM NAME=Menu VALUE=-1><PARAM [b]"[/b] +
[b]"[/b]NAME=Base VALUE=><PARAM NAME=AllowScriptAccess[b]"[/b] +
[b]"[/b] VALUE=always><PARAM NAME=Scale VALUE=ShowAll><PARAM [b]"[/b] +
[b]"[/b]NAME=DeviceFont VALUE=0><PARAM NAME=EmbedMovie [b]"[/b] +
[b]"[/b]VALUE=0><PARAM NAME=BGColor VALUE=><PARAM NAME=SWRemote [b]"[/b] +
[b]"[/b]VALUE=><PARAM NAME=MovieData VALUE=><PARAM [b]"[/b] +
[b]"[/b]NAME=SeamlessTabbing VALUE=1><embed src=MEB_Banner.swf [b]"[/b] +
[b]"[/b]quality=high [b]"[/b] +
[b]"[/b]pluginspage=http://www.macromedia.com/go/getflashplayer [b]"[/b] +
[b]"[/b] type=application/x-shockwave-flash width=600 [b]"[/b] +
[b]"[/b]height=100></embed></OBJECT></asp:panel>";

Note the use of double quotes to use internal single quotes without denoting two single quotes by executing SET QUOTED_IDENTIFIER OFF; prior to the update query.
 
Back
Top