PARSENAME function TIP#29

As the name suggested PARSENAME is the SQL Server function which provide help in parsing.

Lets understand this by an example

Suppose , I have an IPAddress variable which I need to parse

DECLARE @IPAddress AS VARCHAR(100)
SET @IPAddress=’412.312.800.713′

SELECT PARSENAME (@IPAddress,1)

The syntax of the parsename is simple

PARSENAME(String,stringPartIndex)

Only few things which  I have observed and limitation of parse name

1) It only works with dot (“.”) delimiter

2) It can parse up to 4 value only

3) Index will start from 1

see the result of above example below

Parsename

Enjoy !!!

Thanks

Leave a Reply

Your email address will not be published. Required fields are marked *

*

code