用游標(biāo)循環(huán)以下,可能效網(wǎng)站推廣率有點低,以下是我寫的一個存儲過程語句供參考
--exec searchkeyword '物理'
Create proc searchkeyword(@keyword varchar(100))
as
begin
declare @tablename varchar(100),@colname varchar(100),@sql nvarchar(2000),@cou int
create table #t
(
tablename varchar(100),
colname varchar(100)
)
declare c1 cursor for
select a.name as TableName,b.name as ColName From sysobjects a
inner join syscolumns b on (a.id=b.id)
where a.xtype='U'
open c1網(wǎng)站推廣
fetch next from c1 into @tablename,@colname
WHILE @@FETCH_STATUS = 0
begin
set @sql='select @count=count(*) from '+@tablename+' where '+@colname+'=@keyword'
begin try
exec sp_executesql @sql, N'@count int out,@keyword varchar(20)', @cou out ,@keyword
end try
begin catch
set @cou=0
end catch
if @cou>0
begin
insert into #t values(@tablename,@colname)
end
fetch next from c1 into @tablename,@colname
end
CLOSE c1
DEALLOCATE c1
select * from #t
end
制作網(wǎng)站相應(yīng)要請網(wǎng)站關(guān)鍵詞優(yōu)化經(jīng)驗豐富的專業(yè)人才來網(wǎng)站設(shè)計再行 真真實實懂網(wǎng)站關(guān)鍵詞優(yōu)化的人,才會用時非常多精力中設(shè)計制作網(wǎng)頁構(gòu)架。作出有那么多的見效網(wǎng)站。sql 數(shù)據(jù)庫中所有表中查詢關(guān)鍵字單位找人做網(wǎng)站,能有那些如此一個誤以為:只不過尋找本地方網(wǎng)絡(luò)制作單位、以為隨便設(shè)計制作個網(wǎng)站就能網(wǎng)上實施交易了,后來沒有任意成果。2004年起,我企業(yè)開頭做網(wǎng)站通過來長期創(chuàng)新 不斷實踐。經(jīng)歷過眾多成就 也有過廣大失敗。十年時間和精力的實戰(zhàn)經(jīng)驗積蓄,使本公司更走向老到。