搜索某个字符串在那个表的那个字段中
来源:互联网 发布:关于p2p网络借贷监管 编辑:程序博客网 时间:2024/06/08 16:35
--搜索某个字符串在那个表的那个字段中
declare @str varchar(100)
set @str='White' --要搜索的字符串
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
/*--测试结果
所在的表及字段: [authors].[au_lname]
--*/
- 搜索某个字符串在那个表的那个字段中
- 搜索某个字符串在那个表的那个字段中
- 搜索某个字符串在那个表的那个字段中
- 搜索某个字符串在那个表的那个字段中
- 搜索某个字符串在那个表的那个字段中
- 搜索某个字符串在那个表的那个字段中
- 搜索某个字符串在那个表的那个字段中
- 搜索某个字符串在那个表的那个字段中
- 搜索某个字符串在那个表的那个字段中
- 搜索某个字符串在那个表的那个字段中
- 搜索某个字符串在那个表的那个字段中
- 搜索某个字符串在那个表的那个字段中
- 搜索某个字符串在那个表的那个字段中
- 搜索某个字符串在那个表的那个字段中
- 搜索某个字符串在那个表的那个字段中
- MySql获取某个字段存在于在那个表
- 在sqlserver中查找某个字段存在于那个表中的语句
- 在sqlserver中查找某个字段存在于那个表中的语句
- 试玩matplotlib碰到的问题
- 《中国贫富标准线》【看看自己是哪一档】
- COM编程入门(第一部分 什么是COM,如何使用COM)
- 更新字符串列表中,指定位置的字符串
- html上传文件的实例
- 搜索某个字符串在那个表的那个字段中
- 从live.com邮箱抢注看JS一用
- 非法字符替换函数
- 又撞警察了……
- 电影《满城尽带黄金甲》周杰伦接受了新浪娱乐独家对话
- outlook&vmware settings
- 野葡萄文学志:封面人物之周杰伦
- 杰伦是个有责任感的人
- 短信字符串分拆