SQL 关键字 Drop Table
假如删除表B,SQL如下:
drop table B
以上SQL 就会把表B 从A 数据库中删除
drop table *** 作存在风险,请慎重 *** 作。
--创建测试表create table t_a(id int,name varchar(10))
create table t_b(id int,name varchar(10))
--测试数据
insert into t_a(id,name) values (1,'a')
--创建 for delete 触发器
create trigger trg_t_a_1
on t_a
for delete
as
begin
insert into t_b
select id,name from deleted
end
--从t_a中删除一条数据
delete from t_a where id=1
delete '临时表名' where (e,f,g) in(select b,c,d from Test)改成
delete '临时表名' where (e,f,g) in(select x.e,x.f,x.g from '临时表名' x,Test y where x.e=y.b and x.f=y.c and x.g=y.d)
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)