October 20, 2011

PARSENAME in SQL Server

PARSENAME function is used for parsing small strings in SQL Server.
It returns value from right side from a string.

Let’s take an more appropriate example where PARSENAME can be very useful.

image

In first statement i have used 1 so it is giving  ‘TableName’ as output from right side.
If i pass 2 it will give ‘SchemaName’ as output.
It works on 4 part only string separated by period.
It is very handy in case like parsing IP Address.

That’s It
Enjoy Learning

1 comment:

Anonymous said...

this is very nice matter

Post a Comment