Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 sp_loginas(User,Password)

Author  Topic 

Ken Blum
Constraint Violating Yak Guru

383 Posts

Posted - 2008-06-17 : 14:46:36
Feeling kinda dumb...
Does this sproc not exist in SQL 2005? Is there another wasy I can login as a use in T-SQL?

sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2008-06-17 : 15:06:02
I have never seen it. What is your requirement?
Go to Top of Page

Ken Blum
Constraint Violating Yak Guru

383 Posts

Posted - 2008-06-17 : 15:10:44
Must have been in some dream.

Looking for T-SQL function that will allow me to login as another user.
Go to Top of Page

sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2008-06-17 : 15:15:30
Why!!! you need to have necessary rights. Only DBA does that.
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-06-17 : 15:17:38
sodeep,

Why are you making an assumption that Ken is not a DBA and/or doesn't have sysadmin rights?

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

Ken Blum
Constraint Violating Yak Guru

383 Posts

Posted - 2008-06-17 : 15:23:34
I am and I do!

I am trying to test some functionality of a function I wrote that uses with SUSER_SNAME, so instead of having to Disconnect/Connect each time for testing I hoped there was a T-SQL that would allow me to login as a different user. OK?
Go to Top of Page

sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2008-06-17 : 16:01:37
quote:
Originally posted by tkizer

sodeep,

Why are you making an assumption that Ken is not a DBA and/or doesn't have sysadmin rights?

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog




Thats right ,infact he is.

KenBlum, Let us know if you find one. I am looking for it so that you don't have disconnect each time.

Go to Top of Page

Ken Blum
Constraint Violating Yak Guru

383 Posts

Posted - 2008-06-17 : 16:08:43
Will do, but I gotta tell ya, if I don't find it here at SQLTEAM then that usually means the answer does not exist!
Go to Top of Page

sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2008-06-17 : 16:12:58
I think so too. Frankly, Donno where to start with?
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-06-20 : 13:31:30
I happened to come across this today: EXECUTE AS. Let us know if it solves your issue.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2008-06-20 : 22:45:47
How you use it Tara?
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-06-21 : 01:59:23
I haven't ever used it. I was searching for another problem today and came upon it. Looking at BOL, it seems it solves Ken's dilemma.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

Ken Blum
Constraint Violating Yak Guru

383 Posts

Posted - 2008-06-30 : 09:56:11
Thanks Tara, that's what I was looking for.
Go to Top of Page
   

- Advertisement -