Question : MS SQL Update - Msg 102, Level 15, State 1, Line 1 Incorrect syntax near '='

Hello Experts,

I'm trying to do an update on a table, by inserting new data into two new columns, however the data includes the '=' sign and I'm getting the following error -

"Msg 102, Level 15, State 1, Line 1 Incorrect syntax near '='"

The update is below, any thoughts as to how to get around this?

Many thanks -

GTN
1:
2:
3:
4:
5:
6:
7:
8:
9:
update dbo.jbsite
set JBMicrosoftSite = '<meta name="msvalidate.01" content="D255660C3D6036D9A2B2AF6441A9B856" />', JBGoogleSite = '<meta name="google-site-verification" content="QoDRyILC_Hr7WDMpGl9KX-UF1p4np5aVPYR6ThftOLk" />'
where JBSSiteID = 1
update dbo.jbsite
set JBMicrosoftSite = '<meta name="msvalidate.01" content="D255660C3D6036D9A2B2AF6441A9B856" />', JBGoogleSite = '<meta name="google-site-verification" content="f52KsZqcEDTcPfbC-akzbV5ojYjDwRazdClT8XzPtTg" />'
where JBSSiteID = 2
update dbo.jbsite
set JBMicrosoftSite = '<meta name="msvalidate.01" content="D255660C3D6036D9A2B2AF6441A9B856" />', JBGoogleSite = '<meta name="google-site-verification" content="mUJ8IklJLtbgglPm_ErBE78wAFhFOErq3lq9XXPvLkk" />'
where JBSSiteID = 3

Answer : MS SQL Update - Msg 102, Level 15, State 1, Line 1 Incorrect syntax near '='

This gives me no error at all.
Do you have some other text you are not showing in the query?

Did you copy this from the web which may include invalid characters?
Try the below (in tempdb).
Cut and paste it - should work without errors.
The last lines are verbatim from your question.
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
use tempdb;
create table dbo.jbsite(jbssiteid int, JBMicrosoftSite varchar(1000), JBGoogleSite varchar(1000))
insert dbo.jbsite(jbssiteid) select 1;
insert dbo.jbsite(jbssiteid) select 2;
insert dbo.jbsite(jbssiteid) select 3;
GO
update dbo.jbsite
set JBMicrosoftSite = '<meta name="msvalidate.01" content="D255660C3D6036D9A2B2AF6441A9B856" />', JBGoogleSite = '<meta name="google-site-verification" content="QoDRyILC_Hr7WDMpGl9KX-UF1p4np5aVPYR6ThftOLk" />'
where JBSSiteID = 1
update dbo.jbsite
set JBMicrosoftSite = '<meta name="msvalidate.01" content="D255660C3D6036D9A2B2AF6441A9B856" />', JBGoogleSite = '<meta name="google-site-verification" content="f52KsZqcEDTcPfbC-akzbV5ojYjDwRazdClT8XzPtTg" />'
where JBSSiteID = 2
update dbo.jbsite
set JBMicrosoftSite = '<meta name="msvalidate.01" content="D255660C3D6036D9A2B2AF6441A9B856" />', JBGoogleSite = '<meta name="google-site-verification" content="mUJ8IklJLtbgglPm_ErBE78wAFhFOErq3lq9XXPvLkk" />'
where JBSSiteID = 3
Random Solutions  
 
programming4us programming4us