sqlserver批量导出存储过程、函数、视图

select text from syscomments s1 join sysobjects s2 on s1.id=s2.id  where xtype = 'V'

xtype

V   视图

P   存储过程

TF 函数

查询结果为创建视图/存储过程/函数的创建语句,如果需要过滤某条数据,上面的sql语句可以加上 name='视图/存储过程/函数 名称'

原文地址:https://www.cnblogs.com/white-knight/p/8485205.html