Thread: What is it? How do you use it?
10-02-04, 22:09 #1Registered User
- Join Date
- May 2004
Unanswered: What is it? How do you use it?
I was reading through a couple of the default stored procedures found within the master database, specifically sp_changedbowner. I noticed that there was a function of somekind that can be seen within the below snippet.
select @sid = get_sid('\U'+@loginame, NULL)
What is get_sid? I searched on Google for an answer but came up with nothing really. Has anyone else bothered trying to determine what this does? When I attempt to use it, I always get a returned value of NULL regardless of what username I use.
Thank you all for your replies.
10-03-04, 11:24 #2Registered User
- Join Date
- Jul 2003
- San Antonio, TX
This looks like the closest answer coming from MS on get_sid(...)
But after experimenting with it the following became clear:
get_sid(...) does not work at all if executed within a T-SQL batch. In fact it does not work even if you create a procedure or a function from the batch. The ONLY time procedure or function will work if you make it a system object with sp_MS_marksystemobject.
"The data in a record depends on the Key to the record, the Whole Key, and
nothing but the Key, so help me Codd."