• Rich Mechaber (2/11/2016)


    Stewart "Arturius" Campbell (2/10/2016)


    Nice one, thanks Steve

    Given that SETUSER is deprecated, and the last two were obviously incorrect, that left only one choice...

    And here I thought SETUSER was something Steve made up; having started working principally with SQL 2005, I've always used EXECUTE AS. A quick look to BOL shows it was deprecated in 2005: https://msdn.microsoft.com/en-us/library/ms186297%28v=sql.90%29.aspx.

    Actually, further search shows it was deprecated even in SQL 2000: https://technet.microsoft.com/en-us/library/aa259240%28v=sql.80%29.aspx, though there's no indication on that page of an alternative command like EXECUTE AS. I wonder if that TechNet entry for SQL 2000 was amended ex post facto. Any SQL 2000 honchos out there remember?

    Rich

    Don't believe EXECUTE AS worked in 2000, but don't have an instance handy. It could have been added in an SP, which was common practice to add functionality back then