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 Global:ClearDir([string] $PATH) | |
{ | |
$AllItemsInPath = $Path + "*" | |
Remove-Item $AllItemsInPath -recurse -force | |
} |
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 Global:CopyFilesInFolder([string] $FromDir, [string] $ToDir, [string] $FileExtension) | |
{ | |
#Destination for files | |
$From = $FromDir + "*" + $FileExtension | |
Copy-Item $From $ToDir | |
} |
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
(DT_WSTR, 4) YEAR( @[System::StartTime] ) | |
+ "-" | |
+ (DT_WSTR, 1)( MONTH( @[System::StartTime] ) < 10 ? (DT_WSTR, 1)"0" : (DT_WSTR, 0)"" ) | |
+ (DT_WSTR, 4) MONTH ( @[System::StartTime] ) | |
+ "-" | |
+ (DT_WSTR, 1)( DAY( @[System::StartTime] ) < 10 ? (DT_WSTR, 1)"0" : (DT_WSTR, 0)"" ) | |
+ (DT_WSTR, 4) DAY ( @[System::StartTime] ) | |
+ " " | |
+ (DT_WSTR, 1)( DATEPART( "Hour" , @[System::StartTime] ) < 10 ? (DT_WSTR, 1)"0" : (DT_WSTR, 0)"" ) | |
+ (DT_WSTR, 2) DATEPART( "Hour" , @[System::StartTime] ) |
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
//note that variable name spaces are not to be used and variables are case sensitive | |
object myVar = Dts.Variables["MyCaseSensitiveVariableName"].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
//be sure to reference System.Xml; | |
//need a using using System.Data.OleDb; | |
//set up an adapter and a data table to iterate over | |
var resultsAdapter = new OleDbDataAdapter(); | |
var resultsTable = new DataTable(); | |
resultsAdapter.Fill(resultsTable, Dts.Variables["ZipCodesResultSet"].Value); | |
var list = new StringBuilder(); | |
int count = 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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Linq.Expressions; | |
using System.Web; | |
using System.Web.Mvc; | |
using System.Web.Mvc.Html; | |
namespace MyProject.Helpers | |
{ |
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 | |
s.name [Schema Name], | |
tables.name [Table Name], | |
c.name [Column Name], | |
ISNULL(i.is_primary_key, 0) [Is Primary Key], | |
t.Name [Data type], | |
c.max_length [Max Length], | |
c.precision , | |
c.scale , | |
c.is_nullable, |
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 | |
'INSERT INTO [dbo.SSISConfig] ' | |
+CHAR(10)+CHAR(13)+CHAR(9) + '([ConfigurationFilter]' | |
+CHAR(13)+CHAR(10)+CHAR(9) + ',[ConfiguredValue]' | |
+CHAR(13)+CHAR(10)+CHAR(9) + ',[PackagePath]' | |
+CHAR(13)+CHAR(10)+CHAR(9) + ',[ConfiguredValueType])' | |
+CHAR(13)+CHAR(10)+CHAR(9) + 'VALUES' | |
+CHAR(13)+CHAR(10)+CHAR(9) + '(N''' + ConfigurationFilter + '''' | |
+CHAR(13)+CHAR(10)+CHAR(9) + ',N'''+ConfiguredValue+'''' | |
+CHAR(13)+CHAR(10)+CHAR(9) + ',N'''+ConfiguredValueType+'''' |
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 NOT EXISTS | |
( | |
SELECT * FROM [information_schema].[columns] | |
WHERE table_name = 'Customer' | |
AND table_schema = 'dbo' | |
AND column_name = 'FavoriteColorId' | |
) | |
BEGIN | |
ALTER TABLE [dbo].[Customer] | |
ADD FavoriteColorId int |
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
--######## FOR STARTING WHEN STOPPED OR STOPPING #################### | |
--IF YOU NEED TO STOP THE SERVER FIRST TO TRUN THE LINE BELOW | |
--EXEC xp_servicecontrol N'STOP',N'SQLServerAGENT'; | |
USE master; | |
GO | |
CREATE TABLE #SQLAgentStatus | |
( | |
Status varchar(50), | |
Timestamp datetime default (getdate()) |
OlderNewer