SELECT
'DOMAIN\USER',
SUBSTRING('DOMAIN\USER',CHARINDEX('\','DOMAIN\USER',0)+1,LEN('DOMAIN\USER'))
From: [email protected]
To: [email protected]
Subject: [mssms] OT: SQL Trim
Date: Mon, 7 Oct 2013 18:21:12 +0000
I always struggle with this… How to trim the domain\ off of of the user name
here?
select
vrs.Name0
as [Machine Name] ,
vru.Unique_User_Name0
as [User Name],
vru.cn0
as [Full 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
IS NOT
NULL
order
by vru.Name0
John Marcum
Sr. Desktop Architect
Bradley Arant Boult Cummings LLP
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.