locked
Delete Record RRS feed

  • Question

  • User-1499457942 posted

    Hi

       I want to check if record exists in table then record should be deleted in Stored Procedure

    Thanks

    Sunday, November 4, 2018 11:26 AM

All replies

  • User61956409 posted

    Hi JagjitSingh,

     I want to check if record exists in table then record should be deleted in Stored Procedure

    You can refer to the following SQL statement:

    If EXISTS (SELECT 1 FROM dbo.tablename WHERE [FieldName]='value_here')
       --execute your Stored Procedure
    ELSE    
        --do what needs to be done if not

    With Regards,

    Fei Han

    Monday, November 5, 2018 2:44 AM
  • User-1716253493 posted

    Im not clear what you mean deleted in sp

    There is simple way to delete with criteria

    And also you can select exist only data without sp

    Monday, November 5, 2018 2:56 AM