标签:logs varchar 单表 image exp foreign har 数据表 put
使用工具:LINQPad4
1.准备数据表
Customer(顾客表)-- Id(自增主键)Name(顾客姓名)Phone(顾客联系方式)
CREATE TABLE [dbo].[Customer]( [Id] [int] IDENTITY(1,1) NOT NULL, [Name] [nvarchar](50) NULL, [Phone] [nvarchar](16) NULL, CONSTRAINT [PK_Customer] PRIMARY KEY CLUSTERED ( [Id] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY]
Order(订单表)-- Id(自增主键)OrderName(订单名称)Content(订单内容)CustomerId(顾客id)
CREATE TABLE [dbo].[Order]( [Id] [int] IDENTITY(1,1) NOT NULL, [OrderName] [nvarchar](50) NULL, [Content] [nvarchar](256) NULL, [CustomerId] [int] NOT NULL, CONSTRAINT [PK_Order] PRIMARY KEY CLUSTERED ( [Id] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] GO ALTER TABLE [dbo].[Order] WITH CHECK ADD CONSTRAINT [FK_CustomerOrder] FOREIGN KEY([CustomerId]) REFERENCES [dbo].[Customer] ([Id]) GO ALTER TABLE [dbo].[Order] CHECK CONSTRAINT [FK_CustomerOrder]
as
sa
as
as
s
s
标签:logs varchar 单表 image exp foreign har 数据表 put
原文地址:http://www.cnblogs.com/YK2012/p/6569117.html