Problems Deleteing

Aug 9, 2006

Hello all.

I am using the following statement to establish which rows have duplicate information using the following statement:


SELECT EMPLOY_REF, SAL_DATE FROM @TEMP_TABLE GROUP BY EMPLOY_REF, SAL_DATE HAVING COUNT(*) > 1


Once i have established these rows I want to delete them from the table. The code i had thought about (but QA doesnt like it) was:


DELETE FROM @TEMP_TABLE
WHERE EMPLOY_REF AND SAL_DATE IN (SELECT EMPLOY_REF, SAL_DATE FROM @TEMP_TABLE GROUP BY EMPLOY_REF, SAL_DATE HAVING COUNT(*) > 1)

Can anyone suggest a way to go about this? Thanks people :)

View 8 Replies


ADVERTISEMENT

Help With Deleteing From Two Linked Tables

Mar 24, 2008

Hi,
know this sounds like a really silly question, but im having a bit of a problem deleting from two linked tables
I have tried doing the following, however it says that it has an error near the ','
Any suggestions??
DELETE FROM meter_quote , client_details FROM meter_quote, client_details INNER JOIN client_details ON meter_quote.Client_ID = client_details.Client_ID
Thanks, Hayley

View 2 Replies View Related

Deleteing Large Bulks Of Data

Feb 2, 2006

Brief background:We are using SQL Server 2000, and one of the tables stores usersessions details (each time our users logs into our system we insert anew record in the session table, and each time user logs out from oursystem we insert another record in the same table).SESSION_ID is the primary key and it is clustered index.The system produces 5 million session records/day.The problem:Each day we transfer the session data (delta only) to other machine andwe want to delete bulk of ~5 million sessions. This should happendwithout any interfering of our customers activity ( in the same time,we should not block the table - new sessions should be created).What is the best way to perform such task ?

View 4 Replies View Related

Deleteing Duplicate Records From My Table

Jul 20, 2005

I just discovered that all my records appear twice inside my table, inother words, they repeat on the row below. How can I delete all of theduplicates? I'm sure there must be a tidy line of sql to do that.Thanks,Bill

View 1 Replies View Related

Error Deleteing Remote File

May 16, 2007

I am trying to delete a remote file as part of an SSIS package. The FTP Task I have to retrieve the file works fine. I use the same remote path variable and connection manager for both tasks. However, when the delete step executes I receive the error:



Error: 0xC002918E at FTP Task, FTP Task: Unable to delete remote files using "FTP Connection Manager 1".

View 11 Replies View Related

Deleteing Millions Records From A Table-faster Way?

Jun 21, 2007

hi!
i am using sql 2005 k with sp1.

I want to delete 30-40 million rows from a transactional table. Whats the fastest way to delete these rows. just to delete 300,000 rows it takes 30 min. also i don't want to truncate the table.

any help would be appreciated

Thanks

View 9 Replies View Related

Deleteing Columns From A Saved Fixed Width File Connection Object

Jun 12, 2006

How do I delete columns in a fixed width column file connection object, after I've saved it I can't remove columns anymore?

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved