国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 開發 > 綜合 > 正文

查詢指定的表在那些數據庫中存在

2024-07-21 02:11:16
字體:
來源:轉載
供稿:網友
  • 本文來源于網頁設計愛好者web開發社區http://www.html.org.cn收集整理,歡迎訪問。

  • --查詢指定的表在那些數據庫中存在

    declare @tbname sysname
    set @tbname='客戶資料'

    declare @dbname sysname,@sql nvarchar(4000),@re bit,@sql1 varchar(8000)
    set @sql1=''
    declare tb cursor for select name from master..sysdatabases
    open tb
    fetch next from tb into @dbname
    while @@fetch_status=0
    begin
     set @sql='set @re=case when exists(select 1 from ['
      [email protected]+']..sysobjects where xtype=''u'' and name='''
      [email protected]+''') then 1 else 0 end'
     exec sp_executesql @sql,n'@re bit out',@re out
     if @re=1 set @[email protected]+' union all select '''[email protected]+''''
     fetch next from tb into @dbname
    end
    close tb
    deallocate tb
    set @sql1=substring(@sql1,12,8000)
    exec(@sql1)
    發表評論 共有條評論
    用戶名: 密碼:
    驗證碼: 匿名發表
    主站蜘蛛池模板: 河北省| 临西县| 措勤县| 宜章县| 莒南县| 龙胜| 观塘区| 蓬安县| 西藏| 潜江市| 丰原市| 即墨市| 淮阳县| 隆尧县| 当雄县| 玉门市| 囊谦县| 桑日县| 天全县| 苏尼特左旗| 汪清县| 尼勒克县| 辰溪县| 班戈县| 资中县| 凤山市| 长兴县| 康乐县| 阿克苏市| 航空| 锡林浩特市| 蛟河市| 辉县市| 安仁县| 恩施市| 台中县| 抚宁县| 彰武县| 松潘县| 桂东县| 林州市|