Get User In Reporting Services

  • Comments posted to this topic are about the item Get User In Reporting Services

  • Good question.Thanks for question Andy.

    --rhythmk
    ------------------------------------------------------------------
    To post your question use below link

    https://www.sqlservercentral.com/articles/forum-etiquette-how-to-post-datacode-on-a-forum-to-get-the-best-help
    🙂

  • Good one, Andy, thank you for the post.

    I got tricked by first two options, and I did not select the first one and selected the other feasible two. Even though it was very simple (at the end) but the wording had me. 🙂

    ww; Raghu
    --
    The first and the hardest SQL statement I have wrote- "select * from customers" - and I was happy and felt smart.

  • Even I missed the first choice and felt later how easy that could have been!!!!;-)

    Thanks.. Andy.. Good One

  • Not really happy with the wording of the answers.

    I left the first option out, because the second option seemed "supersede" the first option.

  • Stewart "Arturius" Campbell (5/26/2014)


    ...as I could not get it working using T-SQL.

    .. you mean, the auto insert?

    ww; Raghu
    --
    The first and the hardest SQL statement I have wrote- "select * from customers" - and I was happy and felt smart.

  • Mighty (5/26/2014)


    Not really happy with the wording of the answers.

    I left the first option out, because the second option seemed "supersede" the first option.

    +1 Agree, @ least I got 2 out of 3 options right :unsure:

    Thanks & Best Regards,
    Hany Helmy
    SQL Server Database Consultant

  • Stewart "Arturius" Campbell (5/27/2014)


    Raghavendra Mudugal (5/26/2014)


    Stewart "Arturius" Campbell (5/26/2014)


    ...as I could not get it working using T-SQL.

    .. you mean, the auto insert?

    that's the one...

    (not trying to sound extreme smart here..)

    actually, I have done this in MSSQL 2000 database. The code was in the Trigger. Say, in one particular grid, where we can add more than 20 rows in the FE and then submit the page, it writes the data to the table and for each row, I need to generate a custom format unique code, some thing like this "APETE/32434/1/PO/2313-A" and I wrote the code in the trigger to take the next available number for "APETE" and increment by 1 or if "APETE" is being used for the first time, then insert, and get next number, all using plain T-SQL and update the data in the #inserted table and then reflect it to the main table.

    you were using 2008, it must be possible, or was there any other issue apart from T-SQL?

    (just a normal curiosity to know what could have gone wrong 🙂 )

    ww; Raghu
    --
    The first and the hardest SQL statement I have wrote- "select * from customers" - and I was happy and felt smart.

  • Terrible "side effect" coding style!!!

    Gaz

    -- Stop your grinnin' and drop your linen...they're everywhere!!!

  • got one option wrong.

    but great question.

    thanks Andy.

  • Gary Varga (5/27/2014)


    Terrible "side effect" coding style!!!

    +10

    Jason...AKA CirqueDeSQLeil
    _______________________________________________
    I have given a name to my pain...MCM SQL Server, MVP
    SQL RNNR
    Posting Performance Based Questions - Gail Shaw[/url]
    Learn Extended Events

  • Interesting question, thanks.

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

  • Never used that proc before. Thanks for the question Andy!

  • Interesting question, I learned something new from this one. Quite good mental exercise, as there's no useful documentation that I could find and I'd never used this function.

    Some of the options are a bit obvious - user names don't have to be in domain user account format because I can run reporting services on a stand alone server that's not part of a domain, it probably won't have to be called in the master database because that would be unwieldy, and it is certainly going to return a user id if the user exists. It also seems pretty likely that a separate check will be needed to see if any subscriptions are owned by that user id. So that left me with two options - returning a non-null id for a non-existent user and the user being removed from RS when removed from active directory, and one of them had to be right and the other wrong. returning an id for a non-existent seemed pretty bizarre, but removing the user automatically would leave the question of what happened to reports or subscriptions owned by the user; I couldn't find any documentation that gave the answer, and didn't think of looking at the function's code or trying an an experiment. If I'd though a bit harder I'd have realised that choosing to orphan reports and subscriptions would be pretty horrid, as would just deleting them, and transferring them to the right new owner by magic isn't feasible so the bizarre behaviour must be it, but instead I leapt for the unwarranted idea that Reporting Services wouldn't do something bizarre so I picked the wrong option.

    Tom

  • Nice walk through of the logic that got you there. I try to do that when I'm writing it too. Getting the right mix of answers is tough!

Viewing 15 posts - 1 through 15 (of 16 total)

You must be logged in to reply to this topic. Login to reply