如何从特定模式中提取存储过程/表/函数?
我需要从特定架构下的 SQL Server 08 数据库中提取所有表、存储过程和函数。我可以过滤 Management Studio 中显示的项目,然后执行Script As ->;为每个项目删除/创建
,但我真的很想避免这种情况,因为架构中有相当多的项目。
有办法做到这一点吗?
编辑:
我已经看过这个问题 (我刚刚发现的可能重复)。我不想按照建议使用外部工具,因为这是在工作中,我需要获得批准才能使用它。我也不想要一个大的创建数据库
脚本 - 我需要为每个表/存储过程/函数提供单独的脚本。
I need to extract all the tables, stored procs and functions from an SQL Server 08 db that are under a particular schema. I could filter the displayed items in Management Studio and then do Script As -> Drop/Create
for each of them, but I would really like to avoid this as there are quite a few items in the schema.
Is there a way to do this?
Edit:
I've had a look at this question (possible duplicate I just found). I'd rather not use an external tool as suggested, since this is at work and I'd need to get approval to use one. Nor do I want one big Create Database
script - I need separate scripts for each table/sproc/function.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
--syscomments 表在 sql 2000 中使用过,您不应该再使用它 - 但此时它是 sys.syscomments 表
--The syscoments table was used back in sql 2000 and you should not use it anymore - but when so it is the sys.syscomments table
Visual Studio 2010 Premium 包括数据库项目工具支持,允许您在数据库之间执行数据库架构比较(您可以仅筛选到指定的数据库架构)并将实时数据库中的所有对象(和配置)提取到 VS2010 数据库项目,每个对象创建一个脚本。
请参阅使用数据库项目。
Visual Studio 2010 Premium includes database project tooling support that allows you to perform database schema comparisons between databases (where you can filter to only a specified database schema) and extract all the objects (and configuration) in a live database to a VS2010 database project, creating a script per object.
See Working with Database Projects.
一些基于
Something based on