Extracting Datasource Connection String UserID to use in Dataset Query

  • I am trying to use the UserID from the Connection string from a datasource login as a parameter in a dataset to retrieve a group of codes by user at runtime. I want to force login for the datasource that is set up in SQLServer 2005 as we are using MAC's with no domain access as well as PC's in our enterprise. We are using Reporting Services 2005. Perhaps a UDF that parses this ID out of the connection string and returns it to the dataset query?

    Any suggestions would be gratly appreciated.

    Bill Lacaille

    Burke Rehabilitation Hospital

    White Plains,NY

  • Not sure if this will give you the right answer but try:

    Declare @user_id varchar(50)

    Set @user_id = suser_sname()

    Select @user_id

    It's what I've used in some scripts to identify the person executing the script.

    Regards,
    Matt

Viewing 2 posts - 1 through 1 (of 1 total)

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