I have a job that is expected to create a view after successful insert of records in SQL Server.
I have used the create view statement in the After SQL section.
The problem is that even though the job fails due to a key violation error, the After SQL executes.
Can I put a condition to execute the After SQL only if the job completes fine or do I need to take the view create to a different job?
Thank You
After SQL in ODBC Stage
Moderators: chulett, rschirm, roy
I'm assuming you are using the ODBC Connector stage. There is no conditional execution of the After SQL. if you enable it, it runs regardless.
Sort of find it strange that the job has to create a view every time it runs. Are you creating a new table every run? If so, why does it matter if the view is created? If the job has an error, and then has to be re-run, won't it create a new table and then require a new view anyway?
But yes - if you need to only create it after a 100% successful run, I'd put it in a follow-on process.
Sort of find it strange that the job has to create a view every time it runs. Are you creating a new table every run? If so, why does it matter if the view is created? If the job has an error, and then has to be re-run, won't it create a new table and then require a new view anyway?
But yes - if you need to only create it after a 100% successful run, I'd put it in a follow-on process.