为什么获胜';t SQL查询运行

本文关键字:SQL 查询 运行 获胜 为什么 | 更新日期: 2023-09-27 17:58:42

我使用的是SQL Server 2005。

以下是我遵循的步骤:

  1. 在"数据连接"上单击鼠标右键
  2. 已添加到服务器的连接
  3. 已选择Microsoft SQL Server(SQL客户端)
  4. 已创建数据库
  5. 右键单击表格部分
  6. 按"添加新查询"
  7. 插入了SQL语句
  8. 已按Execute SQL语句

我使用了这个SQL语句来尝试运行它:

CREATE TABLE [dbo].[Title](
    [id] [int] IDENTITY(1000,1) NOT NULL,
    [name] [nvarchar](30) NULL,
    [artist] [nvarchar](40) NULL,
    [price] [money] NULL,
    [length] [float] NULL,
    CONSTRAINT [PK_title] PRIMARY KEY CLUSTERED  ( [id] ASC )
) ON [PRIMARY]
GO
INSERT INTO [dbo].[Title] ([name],[artist], [price], [length]) 
VALUES (N'Dhoom Machale', N'Aditi Singh Sharma', CAST(5.99 AS Money), 7.45)
INSERT INTO [dbo].[Title] ([name],[artist], [price], [length]) 
VALUES (N'Mat Maari', N'Kunal Ganjawala, Sunidhi Chauhan', CAST(4.50 AS Money), 6.45)
INSERT INTO [dbo].[Title] ([name],[artist], [price], [length]) 
VALUES (N'Paani Paani',N'Honey Singh', CAST(2.90 AS Money), 4.5)
INSERT INTO [dbo].[Title] ([name],[artist], [price], [length]) 
VALUES (N'Dhanush Sachin Anthem', N'Dhanush', CAST(3.50 AS Money), 4.45)
INSERT INTO [dbo].[Title] ([name],[artist], [price], [length]) 
VALUES (N'Hamari Atariya Pe', N'Rekha Bhardwaj', CAST(4.00 AS Money), 4.43)
INSERT INTO [dbo].[Title] ([name],[artist], [price], [length]) 
VALUES (N'Kabhi Jo Badal Barse', N'Arijit Singh', CAST(3.40 AS Money), 5.05)
INSERT INTO [dbo].[Title] ([name],[artist], [price], [length]) 
VALUES (N'Do Rang Duniya Ke Aur Do Raste', N'Mukesh', CAST(2.75 AS Money), 4.35)
INSERT INTO [dbo].[Title] ([name],[artist], [price], [length]) 
VALUES (N'Mera Joota Hai Japani', N'Mukesh', CAST(1.97 AS Money), 5.15)
INSERT INTO [dbo].[Title] ([name],[artist], [price], [length]) 
VALUES (N'Full Jhol', N'Mika Singh, Akasa Singh', CAST(2.45 AS Money), 5.05)
INSERT INTO [dbo].[Title] ([name],[artist], [price], [length]) 
VALUES (N'Kaddu Katega', N'Antara Mitra', CAST(3.24 AS Money), 4.25)
INSERT INTO [dbo].[Title] ([name],[artist], [price], [length]) 
VALUES (N'Tujse Door Jo Hota Hunn',N'Gajendra Verma', CAST(2.45 AS Money), 3.45)
INSERT INTO [dbo].[Title] ([name],[artist], [price], [length]) 
VALUES (N'Chura Liya Hai Tumne Jo Dil Ko',N'Asha Bhosle, Mohammad Rafi', CAST(3.55 AS Money), 4.05)
INSERT INTO [dbo].[Title] ([name],[artist], [price], [length]) 
VALUES (N'Deewana Mujh Sa Nahin',N'Mohammad Rafi', CAST(4.35 AS Money), 4.25)

我得到的错误是这个

为什么我会出现此错误?

为什么获胜';t SQL查询运行

取出GO语句。

Visual Studio/SQL Server数据工具使用ADO.NET数据访问接口。数据库引擎无法识别GO,只能识别Management Studio和OSQL/SQLCMD。

SQL Server GO关键字