I am using a shared MS SQL server on Godaddy. I noticed this morning that my each record was duplicated 5 times

Is it possible at all that godaddy server did this?  I cannot think of any queries I have run to make this possible.

Please please help!!
goodkAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

ste5anSenior DeveloperCommented:
If this is the case, then it's an issue for the GoDaddy support.

Just run a DBCC CHECDB to test the database integrity.
goodkAuthor Commented:
Msg 7983, Level 14, State 36, Line 2
User 'kenkenken' does not have permission to run DBCC checkdb for database 'kenkenken'.
goodkAuthor Commented:
Use [kenkenken] DBCC CheckDB
Your Guide to Achieving IT Business Success

The IT Service Excellence Tool Kit has best practices to keep your clients happy and business booming. Inside, you’ll find everything you need to increase client satisfaction and retention, become more competitive, and increase your overall success.

ste5anSenior DeveloperCommented:
Then contact the support.. it maybe database or index corruption.
goodkAuthor Commented:
id               description                                      date                                      timestamp
13707      Borrowed from BO Starcity      2014-08-27 00:00:00.000      2014-11-24 12:07:58.237
14646      Borrowed from BO Starcity      2014-08-27 00:00:00.000      2014-11-24 12:07:58.237
15546      Borrowed from BO Starcity      2014-08-27 00:00:00.000      2014-11-24 12:07:58.237
15809      Borrowed from BO Starcity      2014-08-27 00:00:00.000      2014-11-24 12:07:58.237
Scott PletcherSenior DBACommented:
I suspect you had a JOIN on the INSERT that caused additional rows to be generated.  But on the extremely limited info so far, there's no way to really know what happened.
Vitor MontalvãoMSSQL Senior EngineerCommented:
id               description                                      date                                      timestamp
 13707      Borrowed from BO Starcity      2014-08-27 00:00:00.000      2014-11-24 12:07:58.237
 14646      Borrowed from BO Starcity      2014-08-27 00:00:00.000      2014-11-24 12:07:58.237
 15546      Borrowed from BO Starcity      2014-08-27 00:00:00.000      2014-11-24 12:07:58.237
 15809      Borrowed from BO Starcity      2014-08-27 00:00:00.000      2014-11-24 12:07:58.237
How did you inserted these rows?
Those are all columns in the table?
goodkAuthor Commented:
Yes they are columns in the table.  There is a possibility in my code that it is adding extra records.  Not sure what is going on? I am planning to review the code.
goodkAuthor Commented:
How can I delete all other identical records except with the lowest ID

Can you suggest a SQL query?
Vitor MontalvãoMSSQL Senior EngineerCommented:
As possible way to delete duplicates.
WITH CTE_LowId AS
    (SELECT MIN(id) MinID, description, date, timestamp
    FROM TableName
    GROUP BY description, date, timestamp)
DELETE FROM TableName T1
INNER JOIN CTE_LowId T2
        WHERE T2.description = T1.description
             AND T2.date = T1.date
             AND T2.timestamp = T1.timestamp
WHERE T1.id > T2.MinId

Open in new window

NOTE: Run this first in a development environment and ONLY when you're sure that it works, then you can run it in Production. As always, perform a backup of the database before run this command.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
goodkAuthor Commented:
thank you
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server

From novice to tech pro — start learning today.