财贸常见问题

持续更新管家婆财贸系列、工贸系列常见问题

比如要查询操作员都在哪些表里存在

declare @jxcsoft varchar(100)
set @jxcsoft='操作员' --单引号中输入要搜索字段内容

declare @s varchar(8000)
declare sele cursor local for
select 'if exists(select 1 from ['+b.name+'] where ['+a.name+'] like ''%'+@jxcsoft+'%'')
print '' ['+b.name+'].['+a.name+']'''
from syscolumns a join sysobjects b on a.id=b.id
where b.xtype='U' and a.status>=0
and a.xusertype in(175,239,231,167)
open sele
fetch next from sele into @s
while @@fetch_status=0
begin
exec(@s)
fetch next from sele into @s
end
close sele
deallocate sele

 



 
 
 











以下是在工贸T9v22.5数据库执行后输出的结果

 [t_gbl_stringlist].[stringname]
 [t_gbl_stringlist].[stringalias]
 [t_gbl_stringlist].[strings]
 [T_GBL_SysCon].[Name]
 [T_GBL_Desktop].[cCaption]
 [t_gbl_ActionList].[DisplayName]
 [t_gbl_MessageList].[DisplayName]
 [T_GBL_EventLog].[Event]
 [T_GBL_FunctionList].[Caption]
 [T_GBL_FunctionList].[OnClick]
 [T_GBL_FunctionList].[Help]