Parse specific strings in SQL Server -


this question has answer here:

i' ve got string:

dealercode = [maz3].accountid:[4340].startdate=[2015-06-01]

select parsename('dealercode = [maz3].accountid:[4340].startdate=[2015-06-01]', 1)  

and on gives me null. how should change query values between dots?

try :

declare @param nvarchar(max) set @param = 'dealercode = [maz3].accountid:[4340].startdate=[2015-06-01]'  select       split.a.value('.', 'varchar(100)') cvs     (     select cast ('<m>' + replace(@param, '.', '</m><m>') + '</m>' xml) cvs  ) cross apply cvs.nodes ('/m') split(a) 

Comments