|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
|
|
#1
|
|||
|
|||
|
I have a stored procedures that was design to remove all records from a particular table. I am developing this application in a ASP.Net environment. The problem I am having is that the procedure deletes all the records except the first record. Here is the stored procedure:
CREATE PROCEDURE DeletePayrollRec AS delete from payrolltrans GO Thanks in advance for your help |
|
#2
|
|||
|
|||
|
This idea might just be a rigged work around, not sure why the 1st record is being left in there. Is there an ID, autonumber, or other numeric field? As long as the field doesn't go into negative values (which usually they don't or shouldn't), just try adding a where clause and it should catch all the records...
Code:
Delete from PayRollTrans where ID > 0 ...or you can just try to TRUNCATE the table? Last edited by Username=NULL : April 22nd, 2004 at 05:20 PM. |
|
#3
|
|||
|
|||
|
THANK YOU!!!
I change the SP to check for a null value in the PK field and it worked. Thanks again! ![]() |
![]() |
| Viewing: Dev Shed Forums > Databases > MS SQL Development > Deleting Records from a MS SQL database |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|