Skip to content

Compare local files with DB objects.

License

Notifications You must be signed in to change notification settings

PDmatrix/vNext.Comparer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

vNext.Comparer

Build Status Codacy Badge

This utility will help you automate the work with the MS SQL database.

This is a console utility, so you will need to pass arguments through the console.

Commands to work with utility:


  1. CompareLocal - Comparison of local scripts with scripts in database.

Required arguments:

COMMAND="CompareLocal" - Command to work with,
CONNECTIONSTRING - The connection string,
DIR - The directory where the scripts are stored.

Optional arguments:

WINMERGE - Flag to open comparison results in the WinMerge

Usage:

vNext.Comparer COMMAND="CompareLocal" CONNECTIONSTRING="connectionstring" dir="directory" WINMERGE

  1. CompareDB - Comparison of scripts in the database with another database

Required arguments:

COMMAND="CompareDb" - Command to work with,
LEFTCONNECTIONSTRING - The connection string of the left database
RIGHTCONNECTIONSTRING - The connection string of the right database.

Optional arguments:

QUERY - Query, to get a list of objects. The query must return the names of the objects in one column,
WINMERGE - Flag to open comparison results in the WinMerge.

Usage:

vNext.Comparer COMMAND="CompareDb" LEFTCONNECTIONSTRING="connectionstring1" RIGHTCONNECTIONSTRING="connectionstring2" QUERY="SELECT DISTINCT SCHEMA_NAME(SCHEMA_ID) + '.' + name FROM sys.procedures  WHERE type = 'P'" WINMERGE

  1. UpdateDb - Update scripts in the database from local files.

Required arguments:

COMMAND="UpdateDb" - Command to work with,
CONNECTIONSTRING - The connection string,
DIR - The directory where the scripts are stored. Also, you can specify individual files that have an extension ".sql".

Usage:

vNext.Comparer COMMAND="UpdateDb" CONNECTIONSTRING="connectionstring" DIR="directory"