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

46次阅读
没有评论

共计 536 个字符,预计需要花费 2 分钟才能阅读完成。

这篇文章给大家介绍 Sql 中怎么批量查看字符所在的表及字段,内容非常详细,感兴趣的小伙伴们可以参考借鉴,希望对大家能有所帮助。

代码如下:
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 中怎么批量查看字符所在的表及字段就分享到这里了,希望以上内容可以对大家有一定的帮助,可以学到更多知识。如果觉得文章不错,可以把它分享出去让更多的人看到。

正文完
 
丸趣
版权声明:本站原创文章,由 丸趣 2023-08-03发表,共计536字。
转载说明:除特殊说明外本站除技术相关以外文章皆由网络搜集发布,转载请注明出处。
评论(没有评论)