troubleshooting Question

Debug "Incorrect syntax near 'FileType'Col"

Avatar of Calyx Teren
Calyx TerenFlag for United States of America asked on
Microsoft SQL ServerMicrosoft SQL Server 2008
5 Comments1 Solution42 ViewsLast Modified:
The first section works fine, but after that, I get an error in this section below. The equals sign looks like it's highlighted. I need to add many more SET statements. How do i avoid the error?

set [FileTypeCol] = 'File Type2'

use [database]

update table
set [FileTypeCol] = 'File Type1'
from table
where [FileTitle] like '%FileType1%'
   or [Content Title] like '%file-type1%'
   or [Content Title] like '%file Type 1%'
   or [Content Title] like '%File_Type1%'

set [FileTypeCol] = 'File Type2'
from table
where [FileTitle] like '%filetyp2%'
   or [Content Title] like '%file_type2%'

set [FileType] = 'File Type 3'
from table
where [FileTypeCol] like '%filetype3%'
   or [Content Title] like '%FileType3%'
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 1 Answer and 5 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 5 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros