sqlserver批量导出视图
select text from syscomments s1 join sysobjects s2 on s1.id=s2.id where xtype = 'V'
sqlserver批量导出存储过程
select text from syscomments s1 join sysobjects s2 on s1.id=s2.id where xtype = 'P'
sqlserver批量导出函数
select text from syscomments s1 join sysobjects s2 on s1.id=s2.id where xtype = 'TF'
xtype取值:
- V 视图
- P 存储过程
- TF 函数
查询结果为创建视图/存储过程/函数的创建语句,如果需要过滤某条数据,上面的sql语句可以加上 name=‘视图/存储过程/函数 名称’
标签:存储,xtype,s2,s1,导出,视图,Server,SQL,id From: https://www.cnblogs.com/privateLogs/p/17600306.html