Installation - DavidRueter/SQLVer GitHub Wiki

SQLVer is installed by executing the script in SQLVer.sql (using SSMS or any other tool that allows you execute SQL commands).

This script is completely non-destructive, and is suitable for installing in any development, test, or production MSSQL database.

There are two "flavors" of SQLVer:

  • SQLVer_Compact.sql installs only the core version tracking capabilities...which is the main purpose of SQLVer
  • SQLVer.sql installs the full set of SQLVer objects that provide lots of additional utilities

Some of the optional extra features in SQLVer.sql require additional configuration and installation steps on the Windows machine that is running SQL server. (These are all installed in a single folder C:\SQLVer).

Version tracking features and many of the extra features work without performing this additional installation. Things that will not work without this additional installation are:

  • CLR build and deploy from inside SQL stored procedures without using VSCode
  • Useful CLR assemblies such as GetHTTP that are super useful for interacting with remote APIs such as OpenAI (ChatGPT)
  • Downloading of Geonames geolocation data and NPMJS packages
  • Hosting CLR assemblies in a tiny HTTP server allowing use of assemblies that cannot run directly inside SQL

Regardless of whether you choose SQLVer_Compact.sql or the full SQLVer.sql, executing the script will do the following:

  1. Create a schmea named SQLVer and create a number of SQL objects in that schema.
  2. Walk through all SQL objects on the server to capture current version information
  3. Install a database trigger to log all DDL changes
  4. In the "full" SQLVer.sql, create some synonyms to simplify use of certain capabilities from a SQL query window in SSMS

Besides adding the database trigger and some synonyms, no other SQL objects or data are modified or deleted.

TO remove SQLVer, you can manually remove the database trigger, the synonyms, and all objects in the sqlver schema. Or you can