declare @str varchar(100)
set @str='我要找的' --要搜索的字符串declare @s varchar(8000)declare tb cursor local forselect '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.idwhere b.xtype='U' and a.status>=0and a.xusertype in(175,239,231,167)open tbfetch next from tb into @swhile @@fetch_status=0beginexec(@s)fetch next from tb into @sendclose tbdeallocate tb