VB.Net如何导出MSSQL 2008的代码或精确的存储过程

VB.Net how to export codes of or exact Stored Procedures of MSSQL 2008

是否可以获取整个存储过程代码并将其保存到文本文件中?

使用OBJECT_DEFINITION函数:

SELECT name, OBJECT_DEFINITION(object_id)
FROM sys.procedures 

顺便说一句,一个简单的 google 搜索(获取存储过程文本 sql 服务器)得到了这个 link. 你应该先 googled。

for getting modified list
SELECT 
    name,
    create_date,
    modify_date
FROM sys.procedures
WHERE create_date = dynamicdate()

to get text of stored preocedure

SELECT text FROM syscomments WHERE id = (SELECT id FROM sysobjects WHERE name = 'spname'

and iterate the first result then pass sp name to second script