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
/* | |
Script name: Purge SSIS Catalog log tables | |
Author: Tim Mitchell (www.TimMitchell.net) | |
Date: 12/19/2018 | |
Purpose: This script will remove most of the operational information from the SSIS catalog. The | |
internal.operations and internal.executions tables, as well as their dependencies, | |
will be purged of all data with an operation created_time value older than the number | |
of days specified in the RETENTION_WINDOW setting of the SSIS catalog. | |
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 OR ALTER PROCEDURE [dbo].[GetGenericReportData] | |
( | |
@Schema VARCHAR(50) | |
, @Table VARCHAR(50) | |
) | |
AS | |
BEGIN |
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
=Parameters!SchemaName.Value & "." & Parameters!TableName.Value |
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
=(Max(Fields!ID.Value, "ReportSchema") < 2) |
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
=LOOKUP("Column001", Fields!ColumnID.Value, Fields!ColumnName.Value, "ReportSchema") |
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 OR ALTER PROC [dbo].[GetGenericReportMetadata] | |
( | |
@Schema VARCHAR(50) | |
, @Table VARCHAR(50) | |
) | |
AS | |
SELECT ROW_NUMBER() OVER (ORDER BY c.column_id) [ID] | |
, 'Column' + RIGHT('000' + CAST(ROW_NUMBER() OVER (ORDER BY c.column_id) AS VARCHAR(10)), 3) [ColumnID] |
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
public void Main() | |
{ | |
// Create a logical file object | |
System.IO.FileInfo theFile = new System.IO.FileInfo(Dts.Variables["vFilename"].Value.ToString()); | |
// If the update date on the file is greater than the date specified in the MinDateStamp | |
// variable, set the variable flag to process the file. | |
if (theFile.Exists | |
&& theFile.LastWriteTime > DateTime.Parse(Dts.Variables["pMinDateStamp"].Value.ToString())) | |
{ |
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
ALTER DATABASE [ChangeTracking] SET change_tracking = ON (change_retention = 14 days) |
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
SELECT * | |
FROM CHANGETABLE(CHANGES dbo.Emp, 478) |
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
DELETE dbo.Emp | |
WHERE FirstName = 'Joey' | |
AND LastName = 'Tribbiani' |
NewerOlder