先把数据库中所有表名称找到 ,然后逐个表查询
declare @name varchar(50),@tt varchar(10)
set @tt = '%abc%'
declare cc cursor for
select name from sysobjects where xtype='U'
open cc
fetch cc into @name
while @@fetch_status = 0
begin
exec('selec *from '+@name +' where abc like '+@tt)
fetch cc into @name
end
like ‘%abc%’
如果单纯查找替换,可以转储SQL文件然后用编辑器搜索。
只有按照表查,没有按照整库查的说法
比如select* from 表名 where abc like ‘%abc%’
或者
select* from 表名 where abc matches “*abc*”
等等