Hossein Zahed

Web Developer, Entrepreneur, Software Educator

How to Find and Count Duplicate Records / Rows in a MSSQL Database Table

Using the code below helps you easily find and count duplicate records of data in a specific table. You just need to change the Column name and Table according to your table. Following query demonstrates usage of GROUP BY, HAVING, ORDER BY in one query and returns the results with duplicate column and its count in descending order.

 

SELECT YourColumn, COUNT(*) AS TotalCount
FROM YourTable
GROUP BY YourColumn
HAVING COUNT(*) > 1
ORDER BY COUNT(*) DESC

 

Regular expression validator firing after postback in asp.net

As usual, I'm really surprised to see what had happened when I attach a regular expression validator to one of my fileupload control. The regular expression validator was firing after every successful fileupload. Yup! The solution is way too simple. Simply, set the IsValid property of the regular expression validator to true.

protected void btnAddDocument_Click(object sender, EventArgs e)
{
    //
    // your logic comes here
    //
 
    regexvalUploadDoc.IsValid = true;
}

 

Search Benchmark - PHP vs ASP vs ASP.NET vs JavaScript vs CGI

Test server specifications:

  • Intel i7 2.66 GHz
  • Windows 7 Ultimate (64-bit)
  • Western Digital 500GB SATA2 GreenPower, 7200 RPM
  • 4 GB of RAM
  • PHP 5.2.9-1 on Apache 2.2.11
  • ASP and ASP.NET tested on IIS 7.5.7000.0
  • CGI (C++) application tested on Apache 2.2.11
  • JavaScript tested on Internet Explorer 8.0.7000.0
  • Zoom Search Engine V6 (build 1013), EnterpriseEdition

 

Searching a small/typical site

400 pages and 266,479 total words (21,271 unique words)

Time is in seconds to generate and display results (the smaller the values the better)

 

 

Searching a medium site

60,000 pages and 2,590,269 total words (153,986 unique words).

Time is in seconds to generate and display results (the smaller the values the better)

 

 

Souce: www.wrensoft.com