你怎么弄个这个题出来?晕~~~~~~~~哈哈自己去改该:declare cursor1 cursor for select name from sysobjects where xtype='u' declare @i varchar(1000),@y varchar(1000),@sql nvarchar(4000),@result int open cursor1 fetch cursor1 into @i while @@fetch_status=0 begin select @y='' select @y=@y+'case when isnumeric(['+a.name+'])=1 then '+a.name+' end=1101 or ' from syscolumns a,sysobjects d where a.id=d.id and d.xtype='U' and d.name=@i select @y=left(@y,len(@y)-4),@sql=N'set @i=case when exists(select 1 from '+@i+' where '+@y+' ) then 1 else 0 end' exec sp_executesql @sql,N'@i int output',@result output if @result=1 select @i fetch cursor1 into @i end close cursor1 deallocate cursor1
能不能举个例子啊,全文索引我没有用过,谢谢
to:zjcxc(邹建)
这个方法实在太复杂了,我这个库有2000多张表
declare @i varchar(1000),@y varchar(1000),@sql nvarchar(4000),@result int
open cursor1
fetch cursor1 into @i
while @@fetch_status=0
begin
select @y=''
select @y=@y+'case when isnumeric(['+a.name+'])=1 then '+a.name+' end=1101 or ' from syscolumns a,sysobjects d where a.id=d.id and d.xtype='U' and d.name=@i
select @y=left(@y,len(@y)-4),@sql=N'set @i=case when exists(select 1 from '+@i+' where '+@y+' ) then 1 else 0 end' exec sp_executesql @sql,N'@i int output',@result output
if @result=1
select @i
fetch cursor1 into @i
end
close cursor1
deallocate cursor1