Is there any way to generate database scripts from a SQL query in SQL Server?

南笙酒味 提交于 2019-12-31 01:46:13

问题


I need to dump the database structure for a SQL Server database, but I need to do it from a SQL query or sqlcmd script.

Is there a valid way to do it?

Thanks


回答1:


Follow the complete steps to generate script with data.

1

2

3

4

5




回答2:


Open object explorer, right click db, tasks, generate scripts, next, script entire databse and all database objects, save to file, next, next, finish.



来源:https://stackoverflow.com/questions/50123959/is-there-any-way-to-generate-database-scripts-from-a-sql-query-in-sql-server

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!