Please start any new threads on our new site at We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 Analysis Server and Reporting Services (2008)
 SSRS 2008 User!UserID
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Constraint Violating Yak Guru

332 Posts

Posted - 10/04/2013 :  12:05:32  Show Profile  Reply with Quote
In a SSRS 2008 report, I see some sql that is accessing User!UserID as a hidden parameter that is supplied to the SSRS report as displayed in the
XML listed below:
<ReportParameter Name="User">
<Value>= right(User!UserID,10)</Value>
<Value>= right(User!UserID,10)</Value>

This value is not coming from any sql that is run in the SSRS report. I am assuming this is some kind of a feature in SSRS 2008, correct?

Thus can you explain to me where the value for the User!UserID is coming from? In addition, would you tell me what the
"right(User!UserID,10)" statement is actually doing?

James K
Flowing Fount of Yak Knowledge

3873 Posts

Posted - 10/04/2013 :  12:19:59  Show Profile  Reply with Quote
UserId is a built-in field in SSRS. If you look in the Expression editor window, you will see that listed under built in fields. At runtime, it will get populated with the userid that is running the report.

I am not familiar with the right(User!UserID,10) in the context of an RDL file, but I would guess that it is taking the rightmost 10 characters of the username. If you are using the Windows Authentication, the UserId is of the form Domain\Username. So perhaps, they are trying to just get the rightmost 10 characters to get the Username?
Go to Top of Page

Constraint Violating Yak Guru

332 Posts

Posted - 10/04/2013 :  17:53:55  Show Profile  Reply with Quote
Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.02 seconds. Powered By: Snitz Forums 2000