日期:2014-05-17 浏览次数:20534 次
-->生成表a
if object_id('a') is not null
drop table a
Go
Create table a([id] smallint,[tm] nvarchar(2),[sp] smallint,[kc] nvarchar(50),[cy] nvarchar(50),[danh] nvarchar(2))
Insert into a
Select 1,N'02',2,null,null,N'aa'
Union all Select 2,N'01',3,null,null,N'aa'
Union all Select 3,N'03',2,null,null,N'aa'
Union all Select 4,N'05',4,null,null,N'bb'
Union all Select 5,N'10',3,null,null,N'cc'
-->生成表b
if object_id('b') is not null
drop table b
Go
Create table b([id] smallint,[tm] nvarchar(2),[sp] nvarchar(50),[kc] smallint,[cy] nvarchar(50),[danh] nvarchar(2))
Insert into b
Select 1,N'02',null,1,null,N'aa'
Union all Select 2,N'01',null,2,null,N'aa'