我的查询语法出错了什么?

时间:2014-04-02 23:40:04

标签: mysql sql

我正在尝试使用ssms中的以下查询在表中插入一行:

INSERT INTO [Reservation].[dbo].[Contacts]
       ([ContactID]
       ,[Name]
       ,[Phone]
       ,[Email]
       ,[QoowayUserName])
VALUES
       (<"100", nvarchar(50),>
       ,<"Vincent Chase", nvarchar(50),>
       ,<"3103331234", nvarchar(50),>
       ,<"vincent_chase@hollywood.com", nvarchar(50),>
       ,<"Username", nvarchar(50),>)
GO

我收到错误:

Msg 102, Level 15, State 1, Line 8
Incorrect syntax near '<'.

我也试过使用单引号。我做错了什么?

1 个答案:

答案 0 :(得分:4)

INSERT INTO Reservation.dbo.Contacts
   (ContactID
   ,Name
   ,Phone
   ,Email
   ,QoowayUserName)
VALUES
   ('100'
   ,'Vincent Chase'
   ,'3103331234'
   ,'vincent_chase@hollywood.com'
   ,'Username')

您可能需要删除&#34; dbo&#34;,如下所示:

INSERT INTO Reservation.Contacts
   (ContactID
   ,Name
   ,Phone
   ,Email
   ,QoowayUserName)
VALUES
   ('100'
   ,'Vincent Chase'
   ,'3103331234'
   ,'vincent_chase@hollywood.com'
   ,'Username')