Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9236143
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T07:13:05+00:00 2026-06-18T07:13:05+00:00

I have a SQL server (2008 R2) that stores metadata for files in a

  • 0

I have a SQL server (2008 R2) that stores metadata for files in a table. Each file has its own Row, and each file has an MD5 calculated and stored for it. I want to print a list of files where the MD5 value occurs more than once in the server, so I can go through and identify files that have been duplicated over time and decide which one to delete. I have a rather messy command full of several inner joins that I found works for my MySQL server from a few years ago, but modifying it to SQL Server hasn’t worked for me yet. Any one know of any easier ways to do this? below is the modified MySQL command I was trying. Thanks

select [IGCSlidesDB].[dbo].[FilePath]
, [IGCSlidesDB].[dbo].[FileSize]
, [IGCSlidesDB].[dbo].[MD5] from [IGCSlidesDB].[dbo].[MD5Tool]
inner join ( select 
    [IGCSlidesDB].[dbo].[FilePath],
    [IGCSlidesDB].[dbo].[FileSize],
    [IGCSlidesDB].[dbo].[MD5] from [IGCSlidesDB].[dbo].[MD5Tool] group by [MD5] having count(*)>1) 
as t2 on ([IGCSlidesDB].[dbo].[MD5Tool].[MD5]=[t2].[MD5])
order by [IGCSlidesDB].[dbo].[MD5Tool].[FilePath];
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T07:13:06+00:00Added an answer on June 18, 2026 at 7:13 am

    Try this:

    ;WITH CTE AS
    (
        SELECT  *, 
                COUNT(*) OVER(PARTITION BY [MD5]) Total
        FROM [IGCSlidesDB].[dbo].[MD5Tool]
    )
    SELECT *
    FROM CTE 
    WHERE Total > 1
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an SQL Server 2008 database with a table that has a column
I have a SQL Server 2008 R2 table with nvarchar(4000) field. Data that stores
I have a table in SQL Server 2008 that stores XML data in an
I am using SQL Server 2008. I have a table (TBL_FILE) that stores user
I have a table in SQL Server 2008 that stores date/time values as varchar(max)
I have a table that stores stock ticks in sql server 2008. It is
I have a web service that stores data in a local SQL Server 2008
We have a SQL Server 2008 database that has stored procedures to handle reads/writes/etc.
If I have a SQL Server 2008 database that uses FILESTREAM and stores 10
I have an EMPLOYEE table in a SQL Server 2008 database which stores information

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.