row count

  •  

     

    I have a problem with rowcount in query, though it returns few rows, the query is not raising an error mesg ,instead it is deleting which is not supposed to do.

  • Try:

    IF EXISTS (

        SELECT *

        FROM Indicator I

        WHERE EXISTS (

            SELECT *

            FROM jobs J

            WHERE J.jobid = I.jobid

                AND EXISTS (

                    SELECT *

                    FROM OPENXML (@empDdoc, '/emps/Item', 1) WITH (ChangeToemp int, emp int) AS X

                    WHERE X.emp = J.empid

                        AND X.changeToemp = 0

                    )

            )

        )

    BEGIN

        ROLLBACK -- assuming in transaction

        RAISERROR('You can not Delete .', 16, 1)

        RETURN

    END

  • sorry..still its not working..I checked the query it returned row but not raising error mesg.

  • Foreign key is much more reliable feature for this.

    _____________
    Code for TallyGenerator

  • what does it mean?

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply