我知道要生成脚本,我们需要按照Management studio中的步骤进行操作;
Right click the database
Select Tasks -> Generate Scripts
(Click next if you get the intro screen)
Select "Select specific database objects"
Pick the objects to generate scripts for (tables, stored procedures, etc...)
Click Next, then specify the output filename
This will generate the schemas only. If you want to do data generating scripts as well, click the Advanced button and scroll down to the "Types of data to script" and change it from "Schema only" to "Data only" or "Schema and data"
Click Finish to generate the script
但我不想每次都这样做,是否有任何查询或SP或函数来做同一个Job,因为我的工作是将远程连接到客户端并获取架构到我的本地并完成工作因此,遵循上述步骤对我来说将是乏味和耗时的。如果有任何现成的脚本可用,那将非常有用。