This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Truncate all tables in a database, by: | |
- dropping all foreign key constraints | |
- truncating all the tables | |
- recreating the dropped foreign key constraints | |
*/ | |
DECLARE @DropConstraints nvarchar(max) | |
DECLARE @TruncateTables nvarchar(max) | |
DECLARE @RecreateConstraints nvarchar(max) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Biml xmlns="http://schemas.varigence.com/biml.xsd"> | |
<# | |
string xBiml = RootNode.GetBiml(); | |
XmlDocument xmlDoc = new XmlDocument(); | |
xmlDoc.LoadXml(xBiml); | |
string sFile = @"C:\temp\myBimlFile.xml"; | |
xmlDoc.Save(sFile); | |
#> | |
</Biml> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--1. Create database | |
CREATE DATABASE CDCTest; | |
GO | |
--2. Create CDC table using AdventureWorksDW2012 database | |
USE CDCTest | |
GO | |
SELECT * | |
INTO DimDepartmentGroup_CDC |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Biml xmlns="http://schemas.varigence.com/biml.xsd"> | |
<Connections> | |
<AdoNetConnection Name="Source" | |
ConnectionString="Data Source=.;Initial Catalog=CDCTest;Integrated Security=True;" | |
Provider="System.Data.SqlClient.SqlConnection, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" | |
CreateInProject="true" /> | |
<AdoNetConnection Name="Destination" | |
ConnectionString="Data Source=.;Initial Catalog=CDCTest;Integrated Security=True;" | |
Provider="System.Data.SqlClient.SqlConnection, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" | |
CreateInProject="true"/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Biml xmlns="http://schemas.varigence.com/biml.xsd"> | |
<Connections> | |
<AdoNetConnection Name="Source" | |
ConnectionString="Data Source=.;Initial Catalog=CDCTest;Integrated Security=True;" | |
Provider="System.Data.SqlClient.SqlConnection, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" | |
CreateInProject="true" | |
/> | |
<AdoNetConnection Name="Destination" | |
ConnectionString="Data Source=.;Initial Catalog=CDCTest;Integrated Security=True;" | |
Provider="System.Data.SqlClient.SqlConnection, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" |