The IP V4 address is a 3-point delimited string that sometimes needs to be processed in the database, such as determining if the IP address is valid.
The usual way to think of it is to write a function, such as using CHARINDEX, substring and other function combinations to obtain the various parts of the IP address, and then processing.
When SQL Server is used to represent objects, it usually takes
The name of the schema , the name of the database , the name of the schema, the name of the object, the name of the linked server, database name. Schema name. Object name , etc.
such as Dbo.tablename, Master.dbo.tablename, [192.168.1.100].master.dbo.tablename
The purpose of the ParseName function is to get the specified portion of the SQL Server object, such as the database name part to get Master.dbo.tablename
Just use Select ParseName (' Master.dbo.tablename ', 3) and the result is master.
Fortunately, the format of the IP V4 is just like [192.168.1.100].master.dbo.tablename this representation,
So we use ParseName (' 192.168.1. 1) Get 100,parsename (' 192.168. 1. 100 ', 2) Get 1,parsename (' 192. 168. 1.100 ', 3) Get 168,parsename ('192. 168.1.100 ', 4) can get 192.
After getting the various parts of the IP address, it is much more convenient to process it.