游客发表

怎样获取某个数据库的所有存储过程SQL语句

发帖时间:2025-11-04 19:37:46

怎样获取某个数据库的所有存储过程SQL语句
样获有存语句复制declare @proc_text varchar(max)   DECLARE get_proc_text_cursor CURSORFOR SELECTif object_id(N+ [name] +) is not null drop proc  + [name] +  CHAR(10) +  CHAR(13)  +    GO   +  CHAR(10) +  CHAR(13) + definition + CHAR(10)  + CHAR(13) + GO FROM sys.sql_modules   innerjoin sysobjects  on sys.sql_modules.object_id = sysobjects.id  and type=p OPEN get_proc_text_cursor   FETCHNEXTFROM get_proc_text_cursor   INTO @proc_text   WHILE @@FETCH_STATUS = 0   BEGIN print @proc_text   FETCHNEXTFROM get_proc_text_cursor   INTO @proc_text   END CLOSE get_proc_text_cursor   DEALLOCATE get_proc_text_cursor  1.2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.18.19.20.

    热门排行

    友情链接