如果要任意就只能创建动态SQL来完成.
解决方案 »
- 请教关于分组文件组问题。
- 请帮忙看一下这存储过程哪里有问题,谢谢
- 再次问问题:如何查询当前执行的最消耗内存的sql语句。
- 如何得到这样的数据
- sql两表相加的问题
- 为什么有一台机子可以连上 SQL Server 7.0 ,却连不上 SQL Server 2000 ?
- 问题一:如何用作业实现SQL的增量自动备份?问题二:如何将SQL备份到其他机器上?
- 求一个简单数据库问题,怎么约束数据行插入或修改不能重复值
- 高分!冷门问题!关于一个dbmagic的数据库
- 什么是最快的将一个SQL SERVER表转存为本地ACCESS表(MDB)的方法?
- MSSQL表对比 出差异表
- MS-SQL查询数据问题,和昨天的那个有点差距
go
create table ta(aid int ,[Name] varchar(10))
insert ta select 1,'A'
insert ta select 2,'A'
if object_id('tb')is not null drop table tb
go
create table tb(bid int ,[Name] varchar(10))
insert tb select 1,'A'
insert tb select 3,'A'
if object_id('tc')is not null drop table tc
go
create table tc(cid int ,[Name] varchar(10))
insert tc select 1,'A'
insert tc select 5,'A'
if object_id('tri_a')is not null drop trigger tri_a
go
create trigger tri_a on tb
for delete
as
delete ta from deleted d where ta.aid=d.bid
delete tc from deleted d where tc.cid=d.bid
go
delete tb where bid=1
select * from ta
select * from tb
select * from tc
/*aid Name
----------- ----------
2 Abid Name
----------- ----------
3 Acid Name
----------- ----------
5 A
*/