createschema.sql

来自「将带您了解SQL Server Compact 3.5的发展历程和功能特性」· SQL 代码 · 共 29 行

SQL
29
字号
CREATE TABLE Suppliers(
      SupplierID nVarChar(10) NOT NULL CONSTRAINT Suppliers_PK PRIMARY KEY,
      CompanyName nvarchar(40) NOT NULL,
      Description nvarchar(100) NULL,
      SortOrder int NOT NULL DEFAULT(50),
      Active bit NOT NULL DEFAULT (1) 
)
GO
CREATE TABLE OrderStatus(
      OrderStatus nChar(10) NOT NULL CONSTRAINT OrderStatus_PK PRIMARY KEY,
      Status nvarchar(40) NOT NULL,
      Description nvarchar(100) NULL,
      SortOrder int NOT NULL DEFAULT(50),
      Active bit NOT NULL DEFAULT (1) 
)
GO
INSERT INTO Suppliers  (SupplierID, CompanyName, Description, SortOrder, Active)
VALUES ('1', 'Exotic Liquids', 'Things that make your skin warm', 1, 1)
GO
INSERT INTO Suppliers  (SupplierID, CompanyName, Description, SortOrder, Active)
VALUES ('2', 'New Orleans Cajun Delights', 'Things that make your stomach warm', 2, 1)
GO
INSERT INTO Suppliers  (SupplierID, CompanyName, Description, SortOrder, Active)
VALUES ('3', 'Grandma Kelly''s Homestead', 'Great bread products', 4, 1)
GO
INSERT INTO Suppliers  (SupplierID, CompanyName, Description, SortOrder, Active)
VALUES ('4', 'Tokyo Traders', 'All sorts of cool stuff', 4, 1)
GO

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?