Batch file in "Script" in the database

Is it possible to somehow use the .bat file for the script schema and / or contents of the SQL Server database?

I can do this with a wizard, but would like to simplify the creation of this file for version control purposes.

I would like to avoid using third-party tools, limited only to the tools that come with SQL Server.

+4
source share
1 answer

There is a free tool Subcommander , which is part of the open source SubSonic . I have successfully used this tool to create each circuit and dump data every night.

You can script to exit your schema and data (and then your favorite source code management system) using Subcommander. Just use the "version" command and tell SubCommander where to place the data:

sonic.exe version / out scripts

This will cause the script file (.sql) to exit to the local scripts directory of your project.

You can also try using the Microsoft SQL Server Database Publishing Wizard , although I'm not sure if you can use it in the bat file.

+6
source

Source: https://habr.com/ru/post/1276399/


All Articles