Thursday, December 18, 2008

Add leading 0 in derive column in SSIS

Sample: REPLICATE("0",20 - LEN(SAQ_CODE_IPC)) + SAQ_CODE_IPC

Friday, December 05, 2008

Add Parameter Mapping in SQL Execute Task

Let’s say if you want to execute a query in the SQL Execute Task to delete the products number = ‘AR-5381’ and color = ‘blue’ and you want to pass the value from the variables, the query as below:

DELETE FROM dbo.Product WHERE ProductNumber = ? AND Color = ?

You will need to setup the parameter mapping, in order to make it query work, you will to enter the number starting from 0 in the parameter name column. There is two parameter here, so the parameter name will be 0 and 1

Wednesday, December 03, 2008

Methods to List all pending changes in the team foundation server

public static void GetPendingChanges(string tfsServer)
{
//connection to TFS Version Control
TeamFoundationServer tfs = TeamFoundationServerFactory.GetServer(tfsServer);
VersionControlServer vcs = (VersionControlServer)tfs.GetService(typeof(VersionControlServer));

//pulling the pending changes
PendingSet[] pending = vcs.GetPendingSets(new string[] { "$/" }, RecursionType.Full);

//start printing them on the screen:
foreach (var item in pending)
{
Console.WriteLine("\n--------------------------------");
Console.WriteLine("User: " + item.OwnerName);
if (item.PendingChanges != null)
{
Console.WriteLine("Number of Checked Out Files: " + item.PendingChanges.Length.ToString());
Console.WriteLine("Files:");
foreach (var change in item.PendingChanges)
{

Console.WriteLine("-File: " + change.ServerItem);
Console.WriteLine("-- ChangeType: " + change.ChangeTypeName);
Console.WriteLine("-- Checked Out: " + change.CreationDate.ToString());
Console.WriteLine("-- Local file" + change.LocalItem);
}
}
}
}