SQLServer

Prerequisites

Follow installation instructions here

We strongly advise to create a dedicated user to extract your metadata. You can check the first part of our documentation

Run extraction script

Once the package has been installed, you should be able to run the following command in your terminal:

castor-extract-sqlserver [arguments]

The script will run and display logs as following:

INFO - Extracting `DATABASE` ...
INFO - Extracting database: query 1/1
INFO - Results stored to /tmp/sqlserver/1706004977-database.csv
...

INFO - Extracting `USER` ...
INFO - Extracting user: query 1/1
INFO - Results stored to /tmp/sqlserver/1706004977-user.csv

INFO - Wrote output file: /tmp/sqlserver/1706004977-summary.json

Credentials

  • -H, --host: MSSQL Host

  • -P, --port: MSSQL Port

  • -d, --database: MSSQL Database

  • -u, --user: MSSQL User

  • -p, --password: MSSQL Password

Other arguments

  • -o, --output: target folder to store the extracted files

Optional arguments

  • --skip-existing: Skip files already extracted instead of replacing them

You can also get help with argument --help

Use ENV variables

If you don't want to specify arguments every time, you can set the following ENV in your .bashrc:

export CASTOR_SQLSERVER_HOST=127.0.0.0
export CASTOR_SQLSERVER_PORT=3306
export CASTOR_SQLSERVER_DATABASE=database
export CASTOR_SQLSERVER_USER=extraction_user
export CASTOR_SQLSERVER_PASSWORD=******

export CASTOR_OUTPUT_DIRECTORY="/tmp/catalog"

Then the script can be executed without any arguments:

castor-extract-sqlserver

It can also be executed with partial arguments (the script looks in your ENV as a fallback):

castor-extract-sqlserver --output /tmp/catalog

Last updated

Was this helpful?