Bigger question is…. Why does it "require" wildcards? Usernames should be a 
known thing.



________________________________
John Marcum
Lead Desktop Engineer
Bradley Arant Boult Cummings LLP
________________________________

From: [email protected] [mailto:[email protected]] On 
Behalf Of [email protected]
Sent: Tuesday, February 11, 2014 12:48 PM
To: [email protected]
Subject: Re: [mssms] SQL: UDA report for specific user

vru.name0 like ‘%’ + @userid + ‘%’

untested, but I’m pretty sure I’ve used that before in my shady past…

From: Beardsley, James<mailto:[email protected]>
Sent: ‎Tuesday‎, ‎February‎ ‎11‎, ‎2014 ‎9‎:‎39‎ ‎AM
To: [email protected]<mailto:[email protected]>

SQL question: I’m trying to put together a report for our helpdesk to use which 
will allow them the ability to confirm that a specific user is matched up to 
the right device. This below works in SQL studio but it requires that I use 
wildcards in the where statement. When building the report, I need that to be a 
prompt/parameter. How do I write this so the @userid variable has wildcards 
around it when it runs? Or if anyone has a better way of reporting on this, let 
me know. I didn’t see a built-in report for a specific user, only for users in 
a specific collection. Maybe I missed it though…

select        upm.UserResourceID,
              upm.MachineID,
              vru.Name0 as [User Name],
              vrs.Name0 as [Machine Name]
from          v_UsersPrimaryMachines upm
left join     v_R_User vru on upm.UserResourceID = vru.ResourceID
left join     v_R_System vrs on upm.MachineID = vrs.ResourceID
where         vru.Name0 like @userid

Thanks,
James
________________________________

IRS Compliance: Any tax advice contained in this communication (including any 
attachments) is not intended or written to be used, and cannot be used, for the 
purpose of (i) avoiding penalties imposed under the Internal Revenue Code or 
applicable state or local tax law or (ii) promoting, marketing, or recommending 
to another party any transaction or matter addressed herein.

________________________________

Confidentiality Notice: This e-mail is intended only for the addressee named 
above. It contains information that is privileged, confidential or otherwise 
protected from use and disclosure. If you are not the intended recipient, you 
are hereby notified that any review, disclosure, copying, or dissemination of 
this transmission, or taking of any action in reliance on its contents, or 
other use is strictly prohibited. If you have received this transmission in 
error, please reply to the sender listed above immediately and permanently 
delete this message from your inbox. Thank you for your cooperation.


________________________________

Confidentiality Notice: This e-mail is from a law firm and may be protected by 
the attorney-client or work product privileges. If you have received this 
message in error, please notify the sender by replying to this e-mail and then 
delete it from your computer.

________________________________

Confidentiality Notice: This e-mail is from a law firm and may be protected by 
the attorney-client or work product privileges. If you have received this 
message in error, please notify the sender by replying to this e-mail and then 
delete it from your computer.

Reply via email to