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
SET NOCOUNT ON; | |
IF OBJECT_ID('tempdb..#Sales') IS NULL | |
BEGIN | |
CREATE TABLE #Sales | |
( | |
RecordKey int NOT NULL | |
, SalesDate date NOT NULL | |
, CONSTRAINT PK_tmp_Sales PRIMARY KEY (RecordKey) | |
) | |
INSERT INTO |
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
----------------------------------------------------------------------------- | |
IF EXISTS | |
( | |
SELECT | |
* | |
FROM | |
dbo.sysobjects | |
WHERE | |
id = OBJECT_ID('dbo.DoubleMetaPhone') | |
AND OBJECTPROPERTY(id, 'IsDeterministic') IN (1, 0) |
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"> | |
<#@ template tier="1" #> | |
<#@ import namespace="Varigence.Biml.CoreLowerer.SchemaManagement" #> | |
<#@ import namespace="System.IO" #> | |
<# | |
var schema = new List<string>{"CMS"}; | |
var ODSCM = RootNode.OleDbConnections["ODS"]; | |
var ODSDB = ODSCM.GetDatabaseSchema(schema, null, ImportOptions.None); | |
string fileNameTemplate = @"C:\Users\fellowsb\Documents\ODSDB\{0}_{1}.sql"; | |
string currentFileName = string.Empty; |
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
-- Really, what you want is probably something like | |
INSERT INTO | |
MeterAudit | |
( | |
MeterAuditId, MeterId, PreviousAuditId /*...*/ | |
) | |
-- Find the last/most recent entry in MeterAudit for all the things we just changed | |
SELECT | |
NEWID() AS MeterAuditId, I.MeterId, MA.PreviousAuditId /*...*/ | |
FROM |
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
<!-- | |
This is the relevant bit of the include that VS makes for the dll | |
--> | |
<ItemGroup> | |
<COMReference Include="WMPLib"> | |
<Guid>{6BF52A50-394A-11D3-B153-00C04F79FAA6}</Guid> | |
<VersionMajor>1</VersionMajor> | |
<VersionMinor>0</VersionMinor> | |
<Lcid>0</Lcid> |
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"> | |
<#@ import namespace="Varigence.Biml.CoreLowerer.SchemaManagement" #> | |
<# | |
var sourceConnection = SchemaManager.CreateConnectionNode("tempdb", @"Provider=SQLNCLI11;Server=localhost\dev2014;Initial Catalog=tempdb;Integrated Security=SSPI;"); | |
var importResult = sourceConnection.ImportDB("dbo", "so%", ImportOptions.ExcludeColumnDefault | ImportOptions.ExcludeViews); | |
foreach (var table in importResult.TableNodes) | |
{ | |
string fileName = string.Format(@"C:\ssisdata\so\{0}_{1}.sql", table.Name, table.Schema.Name); | |
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
####################### | |
function Get-Type | |
{ | |
param($type) | |
$types = @( | |
'System.Boolean', | |
'System.Byte[]', | |
'System.Byte', | |
'System.Char', |
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
CREATE VIEW dbo.MyPatchLevel | |
AS | |
WITH MostRecentBuild AS | |
( | |
SELECT | |
SRC.Build | |
, SRC.[Release Date] | |
, SRC.SimpleVersion | |
, SRC.[KB / Description] | |
FROM |
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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
using Microsoft.SqlServer.Dts.Runtime; | |
namespace ParameterPasser | |
{ | |
/// <summary> |
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
![Connection Manager General tab ][1] | |
![Connection Manager preview][2] | |
![Data flow][3] | |
[1]: http://i.stack.imgur.com/aXZqb.png | |
[2]: http://i.stack.imgur.com/6i7iY.png |