Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do you delete a bunch of Null records

Status
Not open for further replies.

DougP

MIS
Dec 13, 1999
5,985
0
36
US
SQL Server7<br>I was trying to update some rows and instead created a Null row for each row already there.<br>So now I have double the number of records.<br>When I open Enterprise Manager and try to delete them. It says they are not delete-able because too many rows have the same Index.<br><br>Any Ideas on how to delete them?<br>Or how do I create a Stored Procedure that wil make each null a unique number startng at 1001 and going to 1400?<br>And then delete them where greater than 1000 <p>DougP<br><a href=mailto: dposton@universal1.com> dposton@universal1.com</a><br><a href= > </a><br> Ask me how Bar-codes can help you be more productive.
 
I have done any SQL Server 7, but if your delete is failing due to the index, can't you drop the index, delete the null rows and then recreate the index?&nbsp;&nbsp;&nbsp;<br><br>Just a guess, not sure if this will work or not. <p>Terry M. Hoey<br><a href=mailto:th3856@txmail.sbc.com>th3856@txmail.sbc.com</a><br><a href= > </a><br>
 
I did not create an Index for that Table and I think thats why it giving the Error. Also I'm checking it right now. there is no Indes and Allow Nulls is checked for that column.<br><br>The data was imported form Access using the DTS Wizard in Enterprise Manager. <p>DougP<br><a href=mailto: dposton@universal1.com> dposton@universal1.com</a><br><a href= > </a><br> Ask me how Bar-codes can help you be more productive.
 
Hi, DougP. Try using a DELETE statement wich selects the rows with IS NULL operator. If you want to replace the so called index, you should to UPDATE these rows with a sequence. I hope this will help you!<br>Regards, <p>Eduard Stoleru<br><a href=mailto:e_stoleru@yahoo.com>e_stoleru@yahoo.com</a><br><a href= > </a><br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top