TSQL - To Split Key=Value string into Key and value Columns
If we want to split a string which is like Key=value format then apply the below query to get the Key and Value strings seperately .
declare @inputData varchar(Max) = 'Customer Name=Surendra Thota'
select SUBSTRING(left(@inputData,Len(@inputData)),0,charindex('=',@inputData)) as [Key],SUBSTRING(left(@inputData,Len(@inputData)),(charindex('=',@inputData)+1),40) as Valuedeclare @inputData varchar(Max) = 'Customer Name=Surendra Thota'
Comments
Post a Comment