if exists(select * from sys.procedures where name='c')
drop proc c
go
create proc c
as
if db_id(N'a')is not null
drop database a
go
create database a
on
(name='a',
filename='d:\a.mdf',size=8,maxsize=9,filegrowth=5)
log on
(name='aa',
filename='d:\aa.ldf',size=7,maxsize=8,filegrowth=5)
go
use a
go
if exists(select * from sys.tables where name='w')
drop table w
go
select * into w from test.dbo.stu where 1=2 --test数据库里有表stu
go
insert into w(name,age,sex,address)
select name,age,sex,address from test.dbo.stu
except
select name,age,sex,address from w
go
drop proc c
go
create proc c
as
if db_id(N'a')is not null
drop database a
go
create database a
on
(name='a',
filename='d:\a.mdf',size=8,maxsize=9,filegrowth=5)
log on
(name='aa',
filename='d:\aa.ldf',size=7,maxsize=8,filegrowth=5)
go
use a
go
if exists(select * from sys.tables where name='w')
drop table w
go
select * into w from test.dbo.stu where 1=2 --test数据库里有表stu
go
insert into w(name,age,sex,address)
select name,age,sex,address from test.dbo.stu
except
select name,age,sex,address from w
go
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货