Skip to content

tokafew420/MDbScriptTool

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Multi Database Script Tool

A tool to run SQL scripts against multiple MSSQL databases.

GitHub (pre-)release Github All Releases

Summary

When you're working on a multi-tenant application, chances are you have multiple databases (one for each client). And there will come times (hopefully not often) when you may need to run a query or a patch across multiple (or all) clients. In SQLServer, the quick and dirty way to accomplish this was to dynamically generate your query and joined it with USE statements. It was simple enough to do and it got the job done.

However in Azure SQL that is not possible because the USE statement is not allowed. You can purchase a tool like Red Gate's SQL Multi Script, which is a pretty good tool, OR as the saying goes "why pay for something when you can do it yourself?"

Releases

Download the latest release from here. Then just unzip and run the MDbScriptTool.exe.

Important! Windows block content downloaded from the internet. Prior to extracting the zip file, unblock it by viewing the zip file properties and unblocking it.

Running Solution

Extensions

  • The Web Essentials 2019 extension is used to compile css and js files for releases. Install the extension from the VS market place.

  • The AutoRunCustomTool extension is used to re-compile the t4 template automatically whenever the *.tt.html file changes.

Building Solution

If building from a fresh download/clone:

  1. Right-click on solution and choose Restore NuGet Packages
  2. Right-click on project and choose Web Compiler > Re-compile all files
  3. Right-click on project and choose Bundler & Minifier > Update Bundles
  4. Rebuild Solution

Important! Windows block content downloaded from the internet. Prior to extracting the zip file, unblock it by viewing the zip file properties and unblocking it.

Alternatives

Here are some other alternatives.