Trey, I finally got it to work once I added the SET NOCOUNT ON as the first line in the SQL command. My command looks like this now:
------------------------------------------------
SET NOCOUNT ON
UPDATE FSFormulaAttrib
SET Attrib_Val = "JWTEST"
WHERE Formula_ID = 316206 AND
Attrib_Code = "JWMATCH"
IF @@ROWCOUNT = 0
BEGIN
RAISERROR ('No rows were updated',11,1)
END
------------------------------------------------
Now, for my next question: Is there any way to get MS SQL to return an error number in the 5th element of the AERROR() array? I'd like to assign an error message of something like 99999 so that I get that value back when I do the AERROR() function. I don't really want to store a message on the server using the SP_AddMessage function.
Jim White
Time is a wonderful teacher. Unfortunately it kills all of its students.