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 48785
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T16:20:04+00:00 2026-05-10T16:20:04+00:00

This has been an adventure. I started with the looping duplicate query located in

  • 0

This has been an adventure. I started with the looping duplicate query located in my previous question, but each loop would go over all 17 million records, meaning it would take weeks (just running *select count * from MyTable* takes my server 4:30 minutes using MSSQL 2005). I gleamed information from this site and at this post.

And have arrived at the query below. The question is, is this the correct type of query to run on 17 million records for any type of performance? If it isn’t, what is?

SQL QUERY:

DELETE tl_acxiomimport.dbo.tblacxiomlistings WHERE RecordID in  (SELECT RecordID     FROM tl_acxiomimport.dbo.tblacxiomlistings     EXCEPT     SELECT RecordID     FROM (         SELECT RecordID, Rank() over (Partition BY BusinessName, latitude, longitude,           Phone ORDER BY webaddress DESC, caption1 DESC, caption2 DESC ) AS Rank     FROM tl_acxiomimport.dbo.tblacxiomlistings     ) al WHERE Rank = 1) 
  • 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. 2026-05-10T16:20:04+00:00Added an answer on May 10, 2026 at 4:20 pm

    Seeing the QueryPlan would help.

    Is this feasible?

    SELECT m.* into #temp FROM tl_acxiomimport.dbo.tblacxiomlistings m  inner join (SELECT RecordID,                     Rank() over (Partition BY BusinessName,                                               latitude,                                                longitude,                                                          Phone                                   ORDER BY webaddress DESC,                                            caption1 DESC,                                            caption2 DESC ) AS Rank               FROM tl_acxiomimport.dbo.tblacxiomlistings            ) al on (al.RecordID = m.RecordID and al.Rank = 1)  truncate table tl_acxiomimport.dbo.tblacxiomlistings  insert into tl_acxiomimport.dbo.tblacxiomlistings      select * from #temp 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This has been asked before (question no. 308581) , but that particular question and
This has been asked before, but the other poster's concern had more to do
This has been really driving me crazy. Web links work fine, but a phone
This has been asked several times, i know, but help me understand something. You
This has been asked a million times it appears, but I must be feeling
This has been bugging me ever since I started learning Ruby five months ago:
This has been asked , but wasn't answered. The answer (use /warn:1 ) doesn't
This has been bugging me for years, but I've just been ignoring it, like
This has been asked before, but was not clarified to the point where I
This has been asked before , I know, but the answers are a bit

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.