Hi,
I have a SP,when the stored procedure (which includes a cursor) is executed through query analyzer, it runs fine, and reports an error everytime it sees. It moves all the values from the source to the destination tables.
However, if the same stored procedure is run as a task/job in SQL
Server Agent, the behaviour is different. The job fails when it see's
the error and ends up skipping records or terminating the procedure
all together. Eg. if there are 100 records in the source table with 10
duplicates, the stored procedure when run through Query Analyzer will
copy the 90 unique records to the destination tables but when run from
SQL-Agent, it copies just 10-15 records.
Any idea why this happens, please let me know