Results 1 to 2 of 2
  1. #1
    Join Date
    May 2004
    Posts
    18

    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.

  2. #2
    Join Date
    Jul 2003
    Location
    San Antonio, TX
    Posts
    3,662
    This looks like the closest answer coming from MS on get_sid(...)

    http://www.derkeiler.com/Newsgroups/...2-10/2691.html

    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."

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •