<DeviceSettings environment="Live"><Hardware><IP connectionType="2" hostName="apick101.illini.genesishealth.com" port="600" protocolType="2" servicePort="10101" macAddress="000BAB2230DA" subnetMask="255.255.255.0" gatewayIPAddress="172.31.12.1" /></Hardware><Software terminalNumber="101" commandTimeout="600" numberOfRetries="5" maximumErrors="300" pollInterval="60" isStartTimeRequired="true" reconnectMinutes="30"><Deduction deductionOfEarningsID="0" maximumBadBadgeSize="0" maximumLogSize="0" isMobile="False" is24HourTime="false" communicationTimeout="4" pinRetries="3" /><WebClient userName="apitech" password="ugVzFTabyWC5tSTiTrE7ng==" useProxy="false" proxyHost="" proxyUserName="" proxyPassword="" proxyPort="0" /></Software></DeviceSettings>
I've tried the following:
SELECT
[Number]
,[Description]
,[Configuration]
-- ,CAST(substring([Configuration], patindex('macAddress=',[Configuration])+2, 12) as nvarchar(max)) as MAC
--,substring([Configuration], patindex('macAddress=',cast ([Configuration])+2, 12)as unsigned) MAC
-- ,substring([Configuration], patindex('%macAddress=%',[Configuration])+2, 12) MAC
FROM [APIHealthcare_Test].[dbo].[Device]
This line: substring([Configuration], patindex('%macAddress=%',[Configuration])+2, 12) MAC returns an "Argument data type xml is invalid for argument 2 of patindex function." error so I know I need to use Cast, just can't figure out the syntax.
Very new to sql.
Can someone help?