OSQL -Umyname -Pmypassword -iScript_01.sql -w200 -e -n
Consolidation.log
Script_01.sql will contain statements like:
Update SASI.AACT set schoolnum='071' where schoolnum in ('000',' ')
update SASI.AATD set schoolnum='071' where schoolnum in ('000',' ')
update SASI.AATP set schoolnum='071' where schoolnum in ('000',' ')
update SASI.ACHS set schoolnum='071' where schoolnum in ('000',' ')
update SASI.ACLS set schoolnum='071' where schoolnum in ('000',' ')
If one of those tables should not exist, how could I have it continue,
but hopefully the log would have a reference to the error?
I am experimenting, but I am unsuccessfull with something like:
BEGIN TRAN
select count(*) from sasi.aact --this could be an update
statement
if @@ERROR =208 GOTO err_handle
select count(*) from sasi.astu
if @@ERROR <> 0 GOTO err_handle
select count(*) from sasi.astu
if @@ERROR <> 0 GOTO err_handle
select count(*) from sasi.astu
if @@ERROR <> 0 GOTO err_handle
err_handle:
return
commit Tran