Stored Procedures in MS SQL Server

The AE database agent can be used to process Stored Procedures for MS SQL.

This page includes the following:

RETURN

The statement RETURN can return a number. This return code can then be written to the job report. The name of the stored procedure is ANGTEST.

Example

SQL_SET_STATEMENT_TERMINATOR TERM='!';
DECLARE @result int;
EXEC @result = ANGTEST;
select @result;!

Notes:

PRINT

The statement PRINT facilitates the output of messages to a user (example: DBCC CHECKDB). These messages are also written to the job report. Job execution continues as usual.

RAISE ERROR

Causes the job to be aborted. The error message is written to the activation report.

See also: