查询指定的表在那些中存在
来源:互联网 发布:jdbc:sqlserver: 编辑:程序博客网 时间:2024/06/05 18:17
<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 728x15, 创建于 08-4-23MSDN */google_ad_slot = "3624277373";google_ad_width = 728;google_ad_height = 15;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
--查询指定的表在那些数据库中存在
declare@tbnamesysname
set@tbname='客户资料'
declare@dbnamesysname,@sqlnvarchar(4000),@rebit,@sql1varchar(8000)
set@sql1=''
declaretbcursorforselectnamefrommaster..sysdatabases
opentb
fetchnextfromtbinto@dbname
while@@fetch_status=0
begin
set@sql='set@re=casewhenexists(select1from['
+@dbname+']..sysobjectswherextype=''U''andname='''
+@tbname+''')then1else0end'
execsp_executesql@sql,N'@rebitout',@reout
if@re=1set@sql1=@sql1+'unionallselect'''+@dbname+''''
fetchnextfromtbinto@dbname
end
closetb
deallocatetb
set@sql1=substring(@sql1,12,8000)
exec(@sql1)
<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 728x15, 创建于 08-4-23MSDN */google_ad_slot = "3624277373";google_ad_width = 728;google_ad_height = 15;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 160x600, 创建于 08-4-23MSDN */google_ad_slot = "4367022601";google_ad_width = 160;google_ad_height = 600;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
--查询指定的表在那些数据库中存在
declare@tbnamesysname
set@tbname='客户资料'
declare@dbnamesysname,@sqlnvarchar(4000),@rebit,@sql1varchar(8000)
set@sql1=''
declaretbcursorforselectnamefrommaster..sysdatabases
opentb
fetchnextfromtbinto@dbname
while@@fetch_status=0
begin
set@sql='set@re=casewhenexists(select1from['
+@dbname+']..sysobjectswherextype=''U''andname='''
+@tbname+''')then1else0end'
execsp_executesql@sql,N'@rebitout',@reout
if@re=1set@sql1=@sql1+'unionallselect'''+@dbname+''''
fetchnextfromtbinto@dbname
end
closetb
deallocatetb
set@sql1=substring(@sql1,12,8000)
exec(@sql1)
<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 728x15, 创建于 08-4-23MSDN */google_ad_slot = "3624277373";google_ad_width = 728;google_ad_height = 15;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 160x600, 创建于 08-4-23MSDN */google_ad_slot = "4367022601";google_ad_width = 160;google_ad_height = 600;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
- 查询指定的表在那些数据库中存在
- 查询指定的表在那些数据库中存在
- 查询指定的表在那些数据库中存在
- 查询指定的表在那些数据库中存在
- 查询指定的表在那些数据库中存在
- 查询指定的表在那些数据库中存在
- 查询指定的表在那些数据库中存在
- 查询指定的表在那些数据库中存在
- 查询指定的表在那些数据库中存在
- 查询指定的表在那些数据库中存在
- 查询指定的表在那些中存在
- 查询指定的对象在那些数据库中存在
- 查询数据库中存在指定字段的表
- 查询字符串数组中是否存在指定的Val
- 搜索指定的数据在哪个对象中存在
- 搜索指定的数据在哪个对象中存在
- 在二维数组中查找指定的序列是否存在
- 查询用户表中都存在那些表
- 查看SQLSERVER加密存储过程,函数,触发器,视图
- 建立treeview树形列表的递归代码
- 通用工资计税方案
- 查询新身份证(18位)的校验位
- 直接从SQL语句问题贴子数据建表并生成建表语句的存储过程
- 查询指定的表在那些中存在
- windows Forms数据绑定全景图
- 开源软件,其实在为利益服务
- 如何让你的SQL运行得更快
- DirectShow 媒体文件回放总结
- 生成字符SQL语句基本规则
- SQL2000常用函数OR语句
- 关于struts+hibernate+spring事务处理的自己一个认识
- 查询分析器远程单步调试存储过程的解决之道