Is there a way to connect as a different user inside of a
script or SP? If so, could someone tell me the syntax (T-
SQL)? With that, I'd need to know how to disconnect or
close that connection and go back to the original
connection that ran the script.
Thanks,
VanUsername or login?
--
Tibor Karaszi, SQL Server MVP
Archive at:
http://groups.google.com/groups?oi=djq&as_ugroup=microsoft.public.sqlserver
"Van Jones" <anonymous@.discussions.microsoft.com> wrote in message
news:070c01c3c320$b7479f40$a501280a@.phx.gbl...
> Is there a way to connect as a different user inside of a
> script or SP? If so, could someone tell me the syntax (T-
> SQL)? With that, I'd need to know how to disconnect or
> close that connection and go back to the original
> connection that ran the script.
> Thanks,
> Van|||SQL Login. Connect as a different sql login from a script
or sp....
>--Original Message--
>Username or login?
>--
>Tibor Karaszi, SQL Server MVP
>Archive at:
>http://groups.google.com/groups?
oi=djq&as_ugroup=microsoft.public.sqlserver
>
>"Van Jones" <anonymous@.discussions.microsoft.com> wrote
in message
>news:070c01c3c320$b7479f40$a501280a@.phx.gbl...
>> Is there a way to connect as a different user inside of
a
>> script or SP? If so, could someone tell me the syntax
(T-
>> SQL)? With that, I'd need to know how to disconnect or
>> close that connection and go back to the original
>> connection that ran the script.
>> Thanks,
>> Van
>
>.
>|||For SQL Login, you can use xp_cmdshell which kicks off OSQL and use the appropriate user in the /U
script.
--
Tibor Karaszi, SQL Server MVP
Archive at: http://groups.google.com/groups?oi=djq&as_ugroup=microsoft.public.sqlserver
"Van Jones" <anonymous@.discussions.microsoft.com> wrote in message
news:1436a01c3c327$010a50e0$a601280a@.phx.gbl...
> SQL Login. Connect as a different sql login from a script
> or sp....
> >--Original Message--
> >Username or login?
> >
> >--
> >Tibor Karaszi, SQL Server MVP
> >Archive at:
> >http://groups.google.com/groups?
> oi=djq&as_ugroup=microsoft.public.sqlserver
> >
> >
> >"Van Jones" <anonymous@.discussions.microsoft.com> wrote
> in message
> >news:070c01c3c320$b7479f40$a501280a@.phx.gbl...
> >> Is there a way to connect as a different user inside of
> a
> >> script or SP? If so, could someone tell me the syntax
> (T-
> >> SQL)? With that, I'd need to know how to disconnect or
> >> close that connection and go back to the original
> >> connection that ran the script.
> >>
> >> Thanks,
> >>
> >> Van
> >
> >
> >.
> >
No comments:
Post a Comment