嗨當我嘗試使用db.ExecuteCommand運行.SQL腳本,我得到這個錯誤Incorrect syntax near the keyword 'IF'
LINQ executecommand
我創建數據庫語句如下
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Users]') AND type in (N'U'))
CREATE TABLE dbo.Users(
[Id] int PRIMARY KEY IDENTITY(1, 1) NOT NULL,
[RoleId] int NOT NULL,
[Name] varchar(50) NOT NULL,
[Gender] char(1) NULL,
[Status] int NOT NULL,
)
任何人都可以幫忙嗎?