(Same problem as yesterday).
Using controlflow in scripts and using 'GO' in a script
conflicts.
I use the control flow to check if the scripts are run
in the correct order and have not run before.
Some scripts 'create' views so a 'GO' is needed
in those scripts. This conflicts with the controlflow.
Any solutions to this 'problem' ?
ben brugmanControl of flow handling is confined inside a batch, we can't change this. So the 'solution' depends
on what you want to do with the control of flow handling.
If you are after exiting the script on error, you can do a raiserror with state 127 if you execute
the script using OSQL (this doesn't work with QA).
Or do a raiserror with a severe severity level. Check out the scripts for pubs and northwind for how
this can be done.
--
Tibor Karaszi, SQL Server MVP
Archive at: http://groups.google.com/groups?oi=djq&as_ugroup=microsoft.public.sqlserver
"ben brugman" <ben@.niethier.nl> wrote in message news:Oy3jy5i6DHA.1556@.tk2msftngp13.phx.gbl...
> (Same problem as yesterday).
> Using controlflow in scripts and using 'GO' in a script
> conflicts.
> I use the control flow to check if the scripts are run
> in the correct order and have not run before.
> Some scripts 'create' views so a 'GO' is needed
> in those scripts. This conflicts with the controlflow.
> Any solutions to this 'problem' ?
> ben brugman
>|||Thanks Tibor,
We are using the QA, using the raiserror with a high (above 19) severity
error, I think
is inappropriate and might lead to confusion.
So we have to work around this 'problem'.
> Check out the scripts for pubs and northwind for how
> this can be done.
What scripts are you refering to ? Where ?
Thanks for your time,
ben brugman
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:u6PSJSj6DHA.2380@.TK2MSFTNGP10.phx.gbl...
> Control of flow handling is confined inside a batch, we can't change this.
So the 'solution' depends
> on what you want to do with the control of flow handling.
> If you are after exiting the script on error, you can do a raiserror with
state 127 if you execute
> the script using OSQL (this doesn't work with QA).
> Or do a raiserror with a severe severity level. Check out the scripts for
pubs and northwind for how
> this can be done.
> --
> Tibor Karaszi, SQL Server MVP
> Archive at:
http://groups.google.com/groups?oi=djq&as_ugroup=microsoft.public.sqlserver
>
> "ben brugman" <ben@.niethier.nl> wrote in message
news:Oy3jy5i6DHA.1556@.tk2msftngp13.phx.gbl...
> > (Same problem as yesterday).
> >
> > Using controlflow in scripts and using 'GO' in a script
> > conflicts.
> >
> > I use the control flow to check if the scripts are run
> > in the correct order and have not run before.
> > Some scripts 'create' views so a 'GO' is needed
> > in those scripts. This conflicts with the controlflow.
> >
> > Any solutions to this 'problem' ?
> >
> > ben brugman
> >
> >
>|||> What scripts are you refering to ? Where ?
The scripts I'm referring to are named instpubs.sql and instmsdb.sql, I believe. They should be
found in the SQL Server install directory and on the SQL Server install CD. You use these scripts to
re-create the database. However, I believe that they use the high severity level technique.
From where are you executing the scripts? If you use OSQL or ISQL, I suggest you check out the state
127 option.
--
Tibor Karaszi, SQL Server MVP
Archive at: http://groups.google.com/groups?oi=djq&as_ugroup=microsoft.public.sqlserver
"ben brugman" <ben@.niethier.nl> wrote in message news:eJv0r1j6DHA.3804@.tk2msftngp13.phx.gbl...
> Thanks Tibor,
> We are using the QA, using the raiserror with a high (above 19) severity
> error, I think
> is inappropriate and might lead to confusion.
> So we have to work around this 'problem'.
> > Check out the scripts for pubs and northwind for how
> > this can be done.
> What scripts are you refering to ? Where ?
> Thanks for your time,
> ben brugman
> "Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
> message news:u6PSJSj6DHA.2380@.TK2MSFTNGP10.phx.gbl...
> > Control of flow handling is confined inside a batch, we can't change this.
> So the 'solution' depends
> > on what you want to do with the control of flow handling.
> > If you are after exiting the script on error, you can do a raiserror with
> state 127 if you execute
> > the script using OSQL (this doesn't work with QA).
> > Or do a raiserror with a severe severity level. Check out the scripts for
> pubs and northwind for how
> > this can be done.
> >
> > --
> > Tibor Karaszi, SQL Server MVP
> > Archive at:
> http://groups.google.com/groups?oi=djq&as_ugroup=microsoft.public.sqlserver
> >
> >
> > "ben brugman" <ben@.niethier.nl> wrote in message
> news:Oy3jy5i6DHA.1556@.tk2msftngp13.phx.gbl...
> > > (Same problem as yesterday).
> > >
> > > Using controlflow in scripts and using 'GO' in a script
> > > conflicts.
> > >
> > > I use the control flow to check if the scripts are run
> > > in the correct order and have not run before.
> > > Some scripts 'create' views so a 'GO' is needed
> > > in those scripts. This conflicts with the controlflow.
> > >
> > > Any solutions to this 'problem' ?
> > >
> > > ben brugman
> > >
> > >
> >
> >
>|||>
> From where are you executing the scripts? If you use OSQL or ISQL, I
suggest you check out the state
> 127 option.
We are using the QA for executing the scripts.
ben brugman
> --
> Tibor Karaszi, SQL Server MVP
> Archive at:
http://groups.google.com/groups?oi=djq&as_ugroup=microsoft.public.sqlserver
>
> "ben brugman" <ben@.niethier.nl> wrote in message
news:eJv0r1j6DHA.3804@.tk2msftngp13.phx.gbl...
> > Thanks Tibor,
> >
> > We are using the QA, using the raiserror with a high (above 19) severity
> > error, I think
> > is inappropriate and might lead to confusion.
> > So we have to work around this 'problem'.
> >
> > > Check out the scripts for pubs and northwind for how
> > > this can be done.
> > What scripts are you refering to ? Where ?
> >
> > Thanks for your time,
> > ben brugman
> >
> > "Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote
in
> > message news:u6PSJSj6DHA.2380@.TK2MSFTNGP10.phx.gbl...
> > > Control of flow handling is confined inside a batch, we can't change
this.
> > So the 'solution' depends
> > > on what you want to do with the control of flow handling.
> > > If you are after exiting the script on error, you can do a raiserror
with
> > state 127 if you execute
> > > the script using OSQL (this doesn't work with QA).
> > > Or do a raiserror with a severe severity level. Check out the scripts
for
> > pubs and northwind for how
> > > this can be done.
> > >
> > > --
> > > Tibor Karaszi, SQL Server MVP
> > > Archive at:
> >
http://groups.google.com/groups?oi=djq&as_ugroup=microsoft.public.sqlserver
> > >
> > >
> > > "ben brugman" <ben@.niethier.nl> wrote in message
> > news:Oy3jy5i6DHA.1556@.tk2msftngp13.phx.gbl...
> > > > (Same problem as yesterday).
> > > >
> > > > Using controlflow in scripts and using 'GO' in a script
> > > > conflicts.
> > > >
> > > > I use the control flow to check if the scripts are run
> > > > in the correct order and have not run before.
> > > > Some scripts 'create' views so a 'GO' is needed
> > > > in those scripts. This conflicts with the controlflow.
> > > >
> > > > Any solutions to this 'problem' ?
> > > >
> > > > ben brugman
> > > >
> > > >
> > >
> > >
> >
> >
>
No comments:
Post a Comment