SQL Server 在表中查找字符串
来源:互联网 发布:江南网络教育 编辑:程序博客网 时间:2024/04/26 17:09
select convert(varchar(255),'') dsca
into #y
where 1=0
-- delete #y
declare @s varchar(255)
set @s='192.168.0.71'
DECLARE bbb cursor for
select table_schema,TABLE_NAME,column_name FROM information_schema.columns
where table_name in (select table_name from information_schema.tables where TABLE_type='BASE TABLE' and table_name like '%%' )
and data_type like '%varchar%'
declare @sch varchar(255)
declare @t varchar(255)
declare @f varchar(255)
open bbb
fetch next from bbb into @sch, @t,@f
while @@fetch_status=0
begin
exec( ' if exists (select * from '+ @sch + '.' + @t+' where '+@f+'='+''''+@s+''''+' ) insert into #y select '+''''+@t+'.'+@f+'''' )
---------------------------下面放个类似的,删除所有表-------------------------------------
godeclare @tbname varchar(250)
declare #tb cursor for select name from sysobjects where objectproperty(id,'IsUserTable')=1
open #tb
fetch next from #tb into @tbname
while @@fetch_status=0
begin
exec('drop table ['+@tbname+']')
fetch next from #tb into @tbname
end
close #tb
deallocate #tb
- SQL Server 在表中查找字符串
- SQL Server 在数据库中查找字符串(不知道表名的情况下 查找字符串)
- SQL Server 中查找字符串在另一字符串中的索引位置问题
- 在SQL SERVER中 用SQL语句查找数据库中含有字段的表名。
- SQL Server 中查找字符串中的子串
- SQL中 在字符串中查找所有中文字符
- 在字符串中查找字符串
- 在字符串中查找字符串
- 在整个SQL SERVER数据库的所有表中查找一个字符(比如姓名)
- 查找SQL SERVER日期转换为字符串
- 教你在SQL Server数据库中拆分字符串函数
- 在sql server中输入'NULL'字符串的有趣发现!
- 在SQL SERVER中批量替换字符串的方法
- 在SQL SERVER中批量替换字符串的方法
- 在SQL SERVER中查询字符串的MD5值
- Sql Server 计算某个字符 在字符串中有多少
- 在SQL SERVER中批量替换字符串的方法
- 在listCtrl中查找字符串
- Linux新手生存笔记[3]——Linux常用命令(1)
- Ehcache缓存的清理问题
- hdu 2067
- 使用64位系统用vs2008开发软件,程序编译后无法连接ODBC的解决办法
- Linux新手生存笔记[3]——Linux常用命令(2)
- SQL Server 在表中查找字符串
- Linux新手生存笔记[4]——重点命令1-awk
- cvBoundingRect的用法
- MFC应用程序如何让窗口居中显示
- 如何更改magento后台地址
- linux增加SWAP空间
- 浏览器渲染原理
- Linux新手生存笔记[5]——重点命令2-sed
- Windows平台的SDK、DDK与WDK