davearia Posted July 19, 2005 Posted July 19, 2005 Hi All, I'm 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: 312px'runat='server' Height='112px' Width='632px'><OBJECT codeBase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0'height='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/getflashplayer'type='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. Quote
Joe Mamma Posted July 19, 2005 Posted July 19, 2005 Is this in query analyzer or using ado.net? Try using a parameterized query if ADO.NET. Try executing something like this. . . [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: 312px'runat='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. Quote Joe Mamma Amendment 4: The right of the people to be secure in their persons, houses, papers, and effects, against unreasonable searches and seizures, shall not be violated, and no warrants shall issue, but upon probable cause, supported by oath or affirmation, and particularly describing the place to be searched, and the persons or things to be seized. Amendment 9: The enumeration in the Constitution, of certain rights, shall not be construed to deny or disparage others retained by the people.
Joe Mamma Posted July 19, 2005 Posted July 19, 2005 oh yeah. . . change the field to text, or ntext. I am sure you arent indexing on this field, are you???? Quote Joe Mamma Amendment 4: The right of the people to be secure in their persons, houses, papers, and effects, against unreasonable searches and seizures, shall not be violated, and no warrants shall issue, but upon probable cause, supported by oath or affirmation, and particularly describing the place to be searched, and the persons or things to be seized. Amendment 9: The enumeration in the Constitution, of certain rights, shall not be construed to deny or disparage others retained by the people.
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.