共計 536 個字符,預(yù)計需要花費 2 分鐘才能閱讀完成。
這篇文章給大家介紹 Sql 中怎么批量查看字符所在的表及字段,內(nèi)容非常詳細,感興趣的小伙伴們可以參考借鑒,希望對大家能有所幫助。
代碼如下:
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
關(guān)于 Sql 中怎么批量查看字符所在的表及字段就分享到這里了,希望以上內(nèi)容可以對大家有一定的幫助,可以學(xué)到更多知識。如果覺得文章不錯,可以把它分享出去讓更多的人看到。