Skip to content

SQL Server genie

arbinada-com edited this page Apr 23, 2020 · 1 revision

SQL Server genie generates and updates database layer on SQL Server 2005 or higher.

Atribute Value
type GenieLamp.Genies.SqlServer.SqlServerGenie
assembly GenieLamp.Genies.SqlServer

Accepted parameters

Parameter name Description
Database.Create Indicates to add database creation to the script
Database.Name Name of database to create
Schemas.Create Indicates to add schema(s) creation to the script
UpdateDatabase.Utility Command line utility to run database updating script
UpdateDatabase.Arguments Command line utility arguments

Produced files

File name Description
CRE_%PROJECT_NAME%.sql SQL script to create database catalog
UPD_%PROJECT_NAME%.sql SQL script to update database catalog
DEL_%PROJECT_NAME%.sql SQL script to delete database catalog

Remarks

Updating script will not delete anything in your database but will add new elements only (i.e. columns, indexes etc). You should manually remove any database objects you need before starting update.

Configuration example

<Genie	name="SqlServer"
	type="GenieLamp.Genies.SqlServer.SqlServerGenie"
	assembly="GenieLamp.Genies.SqlServer"
	active="false"
	outDir="%PROJECT_DIR%/../SQL/SqlServer-%TARGET_VERSION%"
	outFileName="%PROJECT_NAME%.sql"
	updateDatabase="true"
	targetVersion="2008">
  <Param name="Database.Create" value="true" />
  <Param name="Database.Name" value="mydb" />
  <Param name="Schemas.Create" value="true" />
  <Param name="UpdateDatabase.Utility" value="sqlcmd" />
  <Param name="UpdateDatabase.Arguments" value="-S localhost -i %FILE_NAME%" />
</Genie>

Clone this wiki locally