How about this something like this?

SUBSTRING(CDR.DPNALPath,13,CHARINDEX(‘.’, CDR.DPNALPath) -13) AS [Server Name]..


Sent From Galaxy Note, please excuse any typo's as result.
www.eskonr.com

--- Original Message ---

From: "Todd Hemsell" <[email protected]>
Sent: November 15, 2013 5:52 AM
To: [email protected]
Subject: [mssms] fnGetSiteSystemName

So in SQL you will see some of these ServerNALPaths relating to the
distribution points.
I always wind up with something like....

REPLACE(SUBSTRING(DPR.DPNALPath, CHARINDEX('\\', DPR.DPNALPath) + 2,
CHARINDEX('"]', DPR.DPNALPath) - CHARINDEX('\\', DPR.DPNALPath) - 3 ),'.
mydomain.com,'')



swhen I want to pull the server name out of the NalPath. They also write
that in the reports.

It seems there is a built in function that does the same thing.

dbo.fnGetSiteSystemName(DPR.DPNALPath) will return the server name. it is a
lot cleaner.





Reply via email to