山寨:不是最好的,是最适合我们的!欢迎体验山寨 中文版MSDN

Blog @ Blog

当华美的叶片落尽,生命的脉络才历历可见。 -- 聂鲁达

常用链接

统计

积分与排名

BBS

Blog

Web

最新评论

SQL创建数据库示例代码

create database Test
go
Use Test
go
create table dbo.AutoTestLog
(
  IsError 
bit,
  Info 
varchar(2000),
  TestDate 
dateTime,
  OP_user 
int,
  GroupNO 
varchar(10),
  
[ID] int identity(1,1primary key ,
  LedAddress 
int,
  Serino 
varchar(30)
)
go
create table dbo.BatchPlan
(
  BatchNo 
varchar(30primary key,
  state 
varchar(30),
  ProductType 
varchar(50),
  jiqicount 
int
)
go
create table dbo.BatchPlandetail
(
  batchNo 
varchar(30) ,
  LedAddress 
int,
  
Primary key(batchNo,LedAddress)
)
go
create table dbo.CrustList
(
  CrustbarCode 
varchar(100primary key,
  opUser 
int,
  crustState 
varchar(100),
  OpTime 
dateTime,
  SeriNo 
varchar(30)
)
go
create table dbo.Departs
(
  
[ID] int primary key,
  Depart_Name 
varchar(50)
)
go
create table dbo.Led
(
  Address 
int primary key
)
go
create table dbo.Logs
(
 
[id] int identity(1,1primary key,
 Computer 
varchar(10),
 Mode_Name 
varchar(50),
 Operate 
varchar(50),
 OP_Date 
datetime,
 OP_user 
int
)
go
create table dbo.MainBoard
(
 barCode 
varchar(100primary key,
 OPUser 
int,
 state 
varchar(100not null,
 opTime 
datetime,
 BoardID 
varchar(30)
)
go
create table dbo.Maintains
(
 
[id] int identity(1,1primary key,
 Product_ID 
varchar(10),
 Problems 
varchar(50),
 isIn 
bit,
 op_date 
datetime,
 op_User 
int
)
go
create table dbo.Product
(
 CrustBarCode 
varchar(30not null
 SeriNo 
varchar(30not null,
 opUser 
int,
 opTime 
datetime
)
go
create table dbo.ProductType
(
  Product_ID 
varchar(10not null,
  Product_name 
varchar(50)
)
go
create table dbo.Users
(
 
[ID] int identity(1,1primary key,
 UserName 
varchar(20),
 
[password] varchar(10),
 Depart_ID 
int
 rightClass 
int,
 LastDate 
datetime
)
go
INSERT INTO [dbo].[Departs]([ID][Depart_Name])
VALUES(1,'测试')
go
INSERT INTO [dbo].[Users][UserName][Password][Depart_ID][RightClass][LastDate])
VALUES'Test''123456'13Getdate())
go
INSERT INTO [dbo].[ProductType]([Product_ID][Product_Name])
select '1','690'
union all
select '2','890'
union all
select '3','981'
go

posted on 2008-06-17 11:43 isabc 阅读(1057) 评论(0)  编辑 收藏 引用 所属分类: 分享代码数据库


只有注册用户登录后才能发表评论。
网站导航: 博客园   IT新闻   BlogJava   知识库   博问   管理


广告信息(免费广告联系)

中文版MSDN:
欢迎体验