August 19, 2008 at 3:52 am
I generated Sql in SQL server 2000 and execeted the samein 2005, it gives error as
Setuser failed because of one of the following reasons: the database principal 'sa' does not exist, its corresponding server principal does not have server access, this type of database principal cannot be impersonated, or you do not have permission.
August 19, 2008 at 8:59 am
A couple of questions:
- where is the database located? on the sql2000 server? if so, is the sql2005 allowed to connect to the sql2000 server?
- does the 'sa' principal exist on the sql2005 instance?
Sidenote for sql2005:
SETUSER is included for backward compatibility only. SETUSER may not be supported in a future release of SQL Server. We recommend that you use EXECUTE AS instead.
Perhaps SETUSER is not working as expected on the sql2005 instance?
Good luck!
August 19, 2008 at 6:48 pm
You cannot setuser to a login account, you must instead setuser to a database account. SA is not a database account, instead setuser to dbo.
Regards
August 20, 2008 at 10:34 pm
Thanks....After setting the user in the database it worked.
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply