我需要將50多行插入到SQL Server 2008中,並且出現一個奇怪的錯誤。請幫忙!SQL SERVER 2008:嘗試使用1個SQL語句插入多行
表設計:
- 名稱:mod_Facilities
- 列
- faclityID,主鍵/索引
- facilityName,爲nvarchar(4000)
- facilityDescription,爲nvarchar(4000)
- statusComment,nvarchar(4000)
- isPublic,位
- isActive,位
- 請將isDeleted,位
錯誤:
Msg 102, Level 15, State 1, Line 3 Incorrect syntax near ','.
這裏是我的SQL語句
INSERT INTO mod_Facilites (facilityName,facilityDescription,isActive,isDeleted)
VALUES
('Conference Room Lower','Conference Room Lower – 25, (AV ready for meetings and info sessions)','true','false'),
('Conference Room Upper','Conference Room Upper – 21, (AV ready for meetings and info sessions)','true','false'),
('Meeting Room A','Meeting Room A – (upper theatre set up capacity 40) ','true','false'),
('Meeting Room B','Meeting Room B – (AV ready classroom set up capacity 25) ','true','false'),
('Meeting Rooms A & B','Meeting Rooms A & B – (AV ready capacity 80)','true','false'),
('OP Resource Room','OP Resource Room','true','false'),
('Climbing Wall','Climbing Wall','true','false'),
('Bouldering Wall','Bouldering Wall','true','false'),
('Entire Climbing Area','Entire Climbing Area','true','false'),
('CPR/First Aid classroom','CPR/First Aid classroom','true','false'),
('Lobby Area','Lobby Area','true','false'),
('Studio 1','Studio 1 ','true','false'),
('Studio 2','Studio 2','true','false'),
('Studio 3','Studio 3','true','false'),
('Studio 4','Studio 4','true','false'),
('Mat Studio','Mat Studio','true','false');
對於那些不熟悉,這是在SQL Server中有效語法2008年。但對於以前版本的SQL Server,您必須使用不同的方法。 – DOK 2011-03-09 17:50:08
因爲你傳遞了var的isActive和isDeleted? – 2011-03-09 17:51:54
如果你通常嘗試'('Mat Studio','Mat Studio',true,false)'(圍繞你的BIT值沒有單引號) - 這會改變什麼嗎? – 2011-03-09 18:03:36