Wednesday, March 7, 2012

How can I ignore errors in script and resume execute this script? thx :)

How can I ignore errors in script and resume execute this script? thx :)IF you are talking about syntax errors in the script you can not..
SQL checks for the syntax of all items in a batch. If ALL the statements
syntax correctly, THEN the batch executes. You can make your batches smaller
by inserting go between statements.
If you are talking about SQL errors while executing a statement, you may
simply ignore the error... However some errors abort the batch and there is
not much (nothing) you can do about that ...
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"atremote" <atremote@.sina.com> wrote in message
news:%235IZGhqfEHA.3944@.tk2msftngp13.phx.gbl...
>
|||By the way...
One thing I used to do is in every batch update a row in a table which had
the version # of the batch... Each batch checked this version number to see
if the batch had to run or had already run... That way, I could fix the
offending batch within the script and just re-run the entire script... It
was a pain in the butt to keep up with , but it worked...
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"atremote" <atremote@.sina.com> wrote in message
news:%235IZGhqfEHA.3944@.tk2msftngp13.phx.gbl...
>

No comments:

Post a Comment