打印本文 打印本文 关闭窗口 关闭窗口
整理了一些t-sql技巧
作者:武汉SEO闵涛  文章来源:敏韬网  点击数16760  更新时间:2007/11/14 13:12:55  文章录入:mintao  责任编辑:mintao
 if @err<>0 goto lberr

--获取数据库集
 exec @err=sp_oagetproperty @srvid,''''databases'''',@dbsid output
 
if @err<>0 goto lberr

--获取要取得脚本的数据库id
 exec @err=sp_oamethod @dbsid,''''item'''',@dbid output,@databasename
 
if @err<>0 goto lberr

--获取要取得脚本的对象id
 exec @err=sp_oamethod @dbid,''''getobjectbyname'''',@tbid output,@objectname
 
if @err<>0 goto lberr

--取得脚本
 exec @err=sp_oamethod @tbid,''''script'''',@re output
 
if @err<>0 goto lberr

 
--print @re
 return(@re)

lberr:
 
exec sp_oageterrorinfo NULL@src out, @desc out 
 
declare @errb varbinary(4)

上一页  [1] [2] [3] [4] [5] [6] [7] [8] [9] [10]  ...  下一页 >> 

打印本文 打印本文 关闭窗口 关闭窗口