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] ... 下一页 >> |