Delete Stored Procedure

Results 1 to 2 of 2

Thread: Delete Stored Procedure

  1. #1
    Join Date
    Dec 1969

    Default Delete Stored Procedure

    I have the following for an insert stored procedure. I have tried to modify it to make it a delete sp as well, but I haven&#039;t had any success. This example looks in one table(field1) and if a value in another table (field1) is not present, it inserts it.<BR>INSERT INTO _tbl_ACL_Devices<BR> (DeviceName)<BR>SELECT DISTINCT Name<BR>FROM ACLDevices<BR>WHERE (Name NOT IN<BR> (SELECT DeviceName<BR> FROM _tbl_ACL_Devices))<BR><BR>I want to do the same with delete. If a value is not in Table1(field1) but it is in Table2(field1), I want to delete it from Table2(field1).

  2. #2
    Join Date
    Dec 1969

    Default RE: Delete Stored Procedure

    delete from table2 where field1 not in (select field1 from table1)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts