Gokul's Blog


Leave a comment

Delete Duplicate records in Sql

Reference Source link : http://blog.sqlauthority.com/2009/06/23/sql-server-2005-2008-delete-duplicate-rows/


/* Delete Duplicate records */
WITH CTE (COl1,Col2, DuplicateCount)
AS
(
SELECT COl1,Col2,
ROW_NUMBER() OVER(PARTITION BY COl1,Col2 ORDER BY Col1) AS DuplicateCount
FROM DuplicateRcordTable
)
DELETE
FROM CTE
WHERE DuplicateCount > 1
GO

Advertisements


Leave a comment

Visual Studio Silent Install

 

I found a couple of interesting articles as I was setting up my new machine

Visual Studio Install: http://mycodelog.com/2010/09/28/silentvs/

sql 2008 silent install: http://mycodelog.com/2010/09/28/sqlsilent/

And also ninite.com is a nice little utility that can be used to install a lot of commonly used applications.

 

 

 

 

 

 

 

 

 

 


Leave a comment

C# Task Library Parallel.Foreach

Sample Usage
var arrayStrings = new string[1000];
Parallel.ForEach<string>(arrayStrings, someString =>
{
    DoSomething(someString);
});


To set the Parallelism
var options = new ParallelOptions { MaxDegreeOfParallelism = 2 };
Parallel.ForEach(dtResult.AsEnumerable(), options, dr =>
		{
		//Do stuff
		});

 


Good Reads: