June 25, 2007 at 10:23 am
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.
June 25, 2007 at 10:51 am
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
June 25, 2007 at 11:26 am
sorry..still its not working..I checked the query it returned row but not raising error mesg.
June 25, 2007 at 4:05 pm
Foreign key is much more reliable feature for this.
_____________
Code for TallyGenerator
June 26, 2007 at 7:16 am
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