主頁 > 知識庫 > Sql 批量查看字符所在的表及字段

Sql 批量查看字符所在的表及字段

熱門標簽:服務外包 呼叫中心市場需求 地方門戶網站 Linux服務器 網站排名優(yōu)化 百度競價排名 AI電銷 鐵路電話系統(tǒng)
復制代碼 代碼如下:

declare @str varchar(100)
set @str='8f8el3l'

declare @s varchar(8000)
declare tb cursor local for
select s='if exists(select 1 from ['+b.name+'] where ['+a.name+'] like ''%'+@str+'%'')
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 tb
fetch next from tb into @s
while @@fetch_status=0
begin
exec(@s)
fetch next from tb into @s
end
close tb
deallocate tb

標簽:崇左 仙桃 銅川 黃山 湘潭 蘭州 衡水 湖南

巨人網絡通訊聲明:本文標題《Sql 批量查看字符所在的表及字段》,本文關鍵詞  ;如發(fā)現本文內容存在版權問題,煩請?zhí)峁┫嚓P信息告之我們,我們將及時溝通與處理。本站內容系統(tǒng)采集于網絡,涉及言論、版權與本站無關。
  • 相關文章
  • 收縮
    • 微信客服
    • 微信二維碼
    • 電話咨詢

    • 400-1100-266