SQL Server interception string (case) function PARSENAME used between two fixed character strings taken and

Internet problem:

 

 


Refer to this " function PARSENAME interception and use the string " https://www.cnblogs.com/insus/p/10958452.html method:

 

DECLARE @str VARCHAR(1000)='||MO21|TMT-0080|1|10'

SET @str = REPLACE(STUFF(@str,1,2,''),'|','.')

SELECT PARSENAME(@str,3)

    --PARSENAME(@str,4) AS [TABLE_CATALOG],
    --PARSENAME(@str,3) AS [TABLE_SCHEMA],
    --PARSENAME(@str,2) AS [TABLE_NAME],
    --PARSENAME(@str,1) AS [COLUMN_NAME]
GO
Source Code

 

Guess you like

Origin www.cnblogs.com/insus/p/10959192.html