Skip to content

liquibase/liquibase-mssql

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

liquibase-mssql Build and Test Extension

MS SQL Server specific extension

This extension wraps insert and load_data commands with "set identity_insert tablename on/off" so that data can be inserted into auto increment columns when using MS SQL Server.

For the Command Line Interface (CLI)
In order to use this extension, copy the liquibase-mssql-.jar file into the lib directory of your liquibase install
For instance if you installed your code into
/opt/liquibase
Copy this file into /opt/liquibase/lib

Then run your liquibase update commands

Example Changelog

<databaseChangeLog
	xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
    xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog
						http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.2.xsd
						http://www.liquibase.org/xml/ns/dbchangelog-ext
						http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">
	<changeSet author="molivasdat" id="123">
        <createTable tableName="rank">
            <column autoIncrement="true" computed="false" name="ID" type="numeric(18, 0)">
                <constraints nullable="false"/>
            </column>
            <column computed="false" name="Name" type="char(50)"/>
        </createTable>
    </changeSet>
    <changeSet id="124" author="mikeo">
        <insert tableName="rank">
            <column name="ID" value="3"/>
            <column name="Name" value="Nota Person"/>
        </insert>
    </changeSet>
    <changeSet author="molivasdat" id="loadData-tbl_rank">
		<loadData tableName="rank" file="mydata_table.csv" relativeToChangelogFile="true" separator=";" quotchar="&quot;">
			<column header="ID" name="ID" type="NUMERIC"/>
			<column header="Name" name="Name" type="STRING"/>
		</loadData>
	</changeSet>
</databaseChangeLog>