Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
Pinto
Aged Yak Warrior
590 Posts |
Posted - 2006-03-01 : 06:44:55
|
| Here's my sp which lists all the records in my parent table with no relative records in my child table. I have tried to convert it a delete query to get rid of the records in tblFileRequests but keep getting a syntax error message. Can anyone put me right. TIACREATE PROCEDURE [spRMU_DeleteBlankRequests] ASSELECT tblFileRequests.MovementId, tblFileRequests.DateRequestedFROM tblFileRequestsLEFT JOIN tblFileRequestDetails ON tblFileRequests.MovementId = tblFileRequestDetails.MovementIdWHERE tblFileRequestDetails.MovementId Is NullGO |
|
|
mwjdavidson
Aged Yak Warrior
735 Posts |
Posted - 2006-03-01 : 07:01:37
|
| [code]DELETE tblFileRequestsFROM tblFileRequestsLEFT JOIN tblFileRequestDetails ON tblFileRequests.MovementId = tblFileRequestDetails.MovementIdWHERE tblFileRequestDetails.MovementId Is Null[/code]Mark |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2006-03-01 : 08:00:36
|
| or Use alias namesDELETE ParentFROM tblFileRequests ParentLEFT JOIN tblFileRequestDetails Child ON Parent.MovementId = Child.MovementIdWHERE Child.MovementId Is NullMadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|