Apache SeaTunnel 作為一個開源的數據集成工具,旨在簡化和加速海量數據的採集和傳輸。 社區的 Committer 是指擁有項目存儲庫的寫許可權的社區成員,即 Committer 可以自行修改代碼、文檔和網站,也可以合併其他成員的貢獻。成為 Apache SeaTunnel Committ ...
--受理編號
declare @slbh varchar(100),@searchColumn varchar(100)
--設置被查詢列值
set @slbh='201703160009'
--設置搜索列名
set @searchColumn='SLBH'
declare @tableName varchar(50)
declare @sql nvarchar(max),@count int
set @sql=N''
set NOCOUNT ON
--優先輸出表,再到視圖
declare tableCursor cursor for select name from sysobjects where xtype='U' --OR xtype='V'
order by xtype asc,name asc
open tableCursor
Fetch next from tableCursor into @tablename
while @@FETCH_STATUS=0
begin
if exists(select name from sys.syscolumns where id=OBJECT_ID(@tableName) and name=@searchColumn)
begin
set @sql='select @count=count(*) from '+@tableName+' where '+@searchColumn+'='''+@slbh+''''
exec sp_executesql @sql,N'@count int output',@count output
if @count>0
begin
select '表名:'+@tableName
set @sql='select * from '+@tableName+' where '+@searchColumn+'='''+@slbh+''''
exec (@sql)
end
end
Fetch next from tableCursor into @tablename
end
close tableCursor
deallocate tableCursor
set NOCOUNT OFF
翻譯
搜索
複製