RE: Setuser failed?
- From: Erland Sommarskog <esquel@xxxxxxxxxxxxx>
- Date: Fri, 22 Aug 2008 14:50:46 -0700
yes (nospam@xxxxxxxxxxxxxxxxxx) writes:
i have 2 sql2005 with sp2 on the first i can use setuser 'sa' on the
second can't, with the same error. why need it?
because i use With execute as owner in procedures and i have another
problme with xp_cmdshell
if i run xp_cmdshell its works, but in the SP not, i would like to try
in he name of SA, i type
setuser 'sa'
exec master..xp_cmdshell 'dir c:\'
setuser
but setuser failed...
SETUSER is deprecated. Don't use it, use EXECUTE AS LOGIN = 'sa' instead.
Note that for the command to be possible, you need to have impersonation
rights on 'sa'.
--
Erland Sommarskog, SQL Server MVP, esquel@xxxxxxxxxxxxx
Links for SQL Server Books Online:
SQL 2008: http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx
SQL 2005: http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx
SQL 2000: http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
.
- References:
- RE: Setuser failed?
- From: yes
- RE: Setuser failed?
- Prev by Date: SQL Server 2000 Vulnerablities
- Next by Date: Re: sp_revoke login is not working as expected.
- Previous by thread: RE: Setuser failed?
- Next by thread: SQL Server 2000 Vulnerablities
- Index(es):
Relevant Pages
|