我想添加一行到數據庫,如果它不存在或更新行,如果它。我哪裏錯了?我已經看了它一千次,並認爲我可能會丟失一些愚蠢的東西...任何人都可以發現此SQL語句中的錯誤嗎? <resolved>
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 is the internal info',
Summary='this is a brief summary of the class')
WHERE Title='this is the class title'
IF @@ROWCOUNT=0
INSERT INTO Classes (Title, Duration, INModule, EditionsFOR, Objectives, PreReq,
Points, ContentLink, OtherInfo, Summary)
VALUES ('this is the 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 is the internal info',
'this is a brief summary of the class')
它是做什麼的?無論如何它插入它? – 2013-04-05 09:52:21
不,只是引發UPDATE語法錯誤。 – 2013-04-05 09:54:05