Sunday, February 12, 2012

Changing DB

I'm getting error message "you can't use USE statement in stored procedure
or trigger".
So the problem is using USE statement in stored procedure.
Sorry what I wasn't clear enough.
Thank you. David P.
"Steve Kass" <skass@.drew.edu> wrote in message
news:eOYNeqmyDHA.1932@.TK2MSFTNGP09.phx.gbl...
quote:

> David,
> You can't use a parameter after USE, but you can do something like
> this, I believe, if you know the names of all the databases that might
> be chosen:
> if @.db = 'somedatabase'
> use somedatabase
> else if @.db = 'differentdatabase'
> use differentdatabase
> else if ...
> If you wish, you can also return silently or throw an error if the value
> passed for @.db is not one you've taken care of.
> SK
>
>
> David Potahisnsky wrote:
>
database.[QUOTE]
working[QUOTE]
it[QUOTE]
doesn't[QUOTE]
>
Sorry - my mistake.
SK
David Potahisnsky wrote:
quote:

>I'm getting error message "you can't use USE statement in stored procedure
>or trigger".
>So the problem is using USE statement in stored procedure.
>Sorry what I wasn't clear enough.
>
>Thank you. David P.
>
>
>"Steve Kass" <skass@.drew.edu> wrote in message
>news:eOYNeqmyDHA.1932@.TK2MSFTNGP09.phx.gbl...
>
>database.
>
>working
>
>it
>
>doesn't
>
>
>

No comments:

Post a Comment