Our instance of SQL Server 2000 contains several databases that are all the same, one for each of our clients. When it is time to update them, we use Red SQL SQL Compare to create a script migration between the development database and a copy of the current database state of all client databases.
SQL Compare generates a script that is transactional; if one step fails, the script rolls back everything. But currently, our system uses a method that breaks the script into packet delimiters (the GO statement ), and then runs each command separately, which destroys all transactional materials. GO statement not supported when querying software database (in classic ASP)
I want to know how I can run this script (save transactions) in all these databases (e.g. 250 DB), programmatically or manually in a tool? In the Query Analyzer, we need to select each database and click Run , which is quite large for the number of databases we have.
I am using sqlcmd external command line tool . I have the same situation on the server on which I work.
I have a script in * .sql file and a list of databases in the second file. I have a small * .bat script that iterates over all the databases and runs the script using the sqlcmd command .
In more detail I like this:
The command line looks more or less:
sqlcmd -S <ComputerName>\<InstanceName> -i <MyScript.sql> -d <database_name> -T
SQL Server 2000 osql
UPDATE
Red Gate SQL Multi script, , . SQL 2000 2008 R2 , .
SSMS SQL 2005 2008, SSMS Tool
7 , :
TAKODEPLOY
:
: https://github.com/andreujuanc/TakoDeploy
, , GO .
, script SQL Compare, . , , .
( ), , , prod, , prod. - ( - , , ). , , UDF, proc. - - , , , , , .
Source: https://habr.com/ru/post/1718312/More articles:implement phone address book - reverse index - language-agnosticКак эффективно использовать значения долготы/широты в Mysql? - mysqlC # method call with parameters from data - reflectionUsing separate jvm to run an applet in separate JVMs does not always work - javaCaching compiled lambda expressions - performanceHTTP POST from ASP.NET MVC Ajax form does not include submit buttons - c #PHP $_SERVER ['HTTP_HOST'] экранирование, выглядит ли это приемлемым? - phpASP.NET MVC Ajax.BeginForm eats the send button options. Looks like a mistake - ajaxAfter a few window.open calls my ASP.NET session - cookiesprotection app.config - VB.Net 3.5 - .netAll Articles