UrlProperty
Retrieves one of select properties of URL string
- Free Function
- SQL Server Compatibility: 2008, 2012, 2014, 2016, 2017
SELECT *
FROM SQLHTTP.net.UrlProperty ( Url, Property )
Name | Type | Description |
---|---|---|
Url | nvarchar(MAX) | String containing a URL web address with an http, https or ftp scheme. |
Property | nvarchar(20) | One of the following string values: AbsolutePath, AbsoluteUri, Authority, DNSSafeHost, Fragment, Host, HostNameType, Port, Query, Scheme and UserInfo as well as LastSegment and TopLevelHost. |
varchar(MAX)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
DECLARE @URL varchar(4000) SET @URL = 'https://www.example.com/path/to/page?name=ferret&color=purple#Top' SELECT SQLHTTP.net.UrlProperty(@Url, 'AbsolutePath') AS AbsolutePath, SQLHTTP.net.UrlProperty(@Url, 'Fragment') AS Fragment, SQLHTTP.net.UrlProperty(@Url, 'Host') AS Host, SQLHTTP.net.UrlProperty(@Url, 'HostNameType') AS HostNameType, SQLHTTP.net.UrlProperty(@Url, 'LastSegment') AS LastSegment, SQLHTTP.net.UrlProperty(@Url, 'Port') AS Port, SQLHTTP.net.UrlProperty(@Url, 'Query') AS Query, SQLHTTP.net.UrlProperty(@Url, 'Scheme') AS Scheme, SQLHTTP.net.UrlProperty(@URL, 'TopLevelHost') AS TopLevelHost |
1 2 3 4 5 |
AbsolutePath Fragment Host HostNameType LastSegment Port Query Scheme TopLevelHost -------------- --------- ---------------- ------------- ------------ ----- -------------------------- ------- ---------------- /path/to/page #Top www.example.com Dns page 443 ?name=ferret&color=purple https example.com |
- AuthListener
- AuthParam
- AuthParamRemove
- AuthParamsClear
- AuthParamSet
- BasicAuthHeader
- FormDataBuilder
- HttpQueueActivity
- HttpRequest
- HttpSession
- IsUrlValid
- OAuthHeader
- QueryStringBuilder
- RaiseHttpError
- RequestHeaderRemove
- RequestHeaders
- RequestHeaderSet
- RequestPartAdd
- ResponseHeaders
- UrlBuilder
- UrlProperty