日期:2014-05-18  浏览次数:20356 次

多表数据库插入
-------------多表数据库插入
我做项目出具的报表是有多个表综合出来的,现在要实现对报表上的一些字段删除(现在有   执行时间、计划价----》它们不属于一个表,删除计划价),但是不知道这个字段属于那个表,要先查出表再插入或删除字段,怎么实现?

------解决方案--------------------
declare @columnname varchar(50)
set @columnname= ' '
select a.name as tablename,b.name as columnname from sysobjects a,syscolumns b
where a.id=b.id and a.xtype= 'u ' andb.name=@columnname