sql update - Can anyone spot the mistake in this SQL statement? <resolved> -


i'm trying add row database if not exist or update row if does. going wrong? i've looked @ thousand times , think may missing silly...

update classes  set (duration='44', inmodule='actions', editionsfor='vocus vpr - basic    edition//vocus pr - enterprise edition//',     objectives='objective 1//objective 2//objective 3//',  prereq='prerequisite    1//prerequisite 2//prerequisite 3//', points='training point   1//training point 2//training point 3//',      contentlink='www.aol.com',  otherinfo='this internal info',  summary='this brief summary of class')  title='this class title'  if @@rowcount=0  insert classes (title, duration, inmodule, editionsfor, objectives, prereq,  points, contentlink, otherinfo, summary)  values ('this class title','44','actions', 'vocus vpr - basic edition//vocus pr - enterprise edition//', 'objective 1//objective 2//objective 3//', 'prerequisite 1//prerequisite 2//prerequisite 3//', 'training point 1//training point 2//training point 3//', 'www.aol.com','this internal info', 'this brief summary of class') 

remove parentheses around set. should written way:

update classes  set duration    = '44',      inmodule    = 'actions',      editionsfor = 'vocus vpr - basic edition//vocus pr - enterprise edition//',     objectives  = 'objective 1//objective 2//objective       3//',      prereq      = 'prerequisite 1//prerequisite 2//prerequisite 3//',      points      = 'training point 1//training point 2//training point 3//',      contentlink = 'www.aol.com',      .... 

Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -