Skip to content

Commit a6090e8

Browse files
authored
Merge pull request #15228 from julieMSFT/20200602_parsename
20200602 parsename
2 parents 02173e3 + 7a9c7bc commit a6090e8

1 file changed

Lines changed: 24 additions & 23 deletions

File tree

docs/t-sql/functions/parsename-transact-sql.md

Lines changed: 24 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "PARSENAME (Transact-SQL) | Microsoft Docs"
33
ms.custom: ""
4-
ms.date: "03/14/2017"
4+
ms.date: "06/02/2020"
55
ms.prod: sql
66
ms.prod_service: "database-engine, sql-database, sql-data-warehouse, pdw"
77
ms.reviewer: ""
@@ -26,7 +26,7 @@ monikerRange: ">=aps-pdw-2016||=azuresqldb-current||=azure-sqldw-latest||>=sql-s
2626
# PARSENAME (Transact-SQL)
2727
[!INCLUDE[tsql-appliesto-ss2012-all-md](../../includes/tsql-appliesto-ss2012-all-md.md)]
2828

29-
Returns the specified part of an object name. The parts of an object that can be retrieved are the object name, owner name, database name, and server name.
29+
Returns the specified part of an object name. The parts of an object that can be retrieved are the object name, schema name, database name, and server name.
3030

3131
> [!NOTE]
3232
> The PARSENAME function does not indicate whether an object by the specified name exists. PARSENAME just returns the specified part of the specified object name.
@@ -35,29 +35,28 @@ monikerRange: ">=aps-pdw-2016||=azuresqldb-current||=azure-sqldw-latest||>=sql-s
3535

3636
## Syntax
3737

38+
```syntaxsql
39+
PARSENAME ('object_name' , object_piece )
3840
```
39-
PARSENAME ( 'object_name' , object_piece )
40-
```
41-
42-
## Arguments
43-
'*object_name*'
44-
Is the name of the object for which to retrieve the specified object part. *object_name* is **sysname**. This parameter is an optionally-qualified object name. If all parts of the object name are qualified, this name can have four parts: the server name, the database name, the owner name, and the object name.
45-
46-
*object_piece*
47-
Is the object part to return. *object_piece* is of type **int**, and can have these values:
4841

49-
1 = Object name
50-
51-
2 = Schema name
52-
53-
3 = Database name
42+
## Arguments
43+
44+
*'object_name'*
45+
Is the parameter that holds the name of the object for which to retrieve the specified object part. This parameter is an optionally-qualified object name. If all parts of the object name are qualified, this name can have four parts: the server name, the database name, the schema name, and the object name. Each part of the 'object_name' string is type *sysname* which is equivalent to nvarchar(128) or 256 bytes. If any part of the string exceeds 256 bytes, PARSENAME will return NULL for that part as it is not a valid sysname.
5446

55-
4 = Server name
47+
*object_piece*
48+
Is the object part to return. *object_piece* is of type **int**, and can have these values:
49+
1 = Object name
50+
2 = Schema name
51+
3 = Database name
52+
4 = Server name
5653

57-
## Return Types
58-
**sysname**
54+
## Return Type
55+
56+
**sysname**
5957

60-
## Remarks
58+
## Remarks
59+
6160
PARSENAME returns NULL if one of the following conditions is true:
6261

6362
- Either *object_name* or *object_piece* is NULL.
@@ -66,10 +65,11 @@ PARSENAME ( 'object_name' , object_piece )
6665

6766
The requested object part has a length of 0 and is not a valid [!INCLUDE[msCoName](../../includes/msconame-md.md)] [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] identifier. A zero-length object name renders the complete qualified name as not valid.
6867

69-
## Examples
68+
## Examples
69+
7070
The following example uses `PARSENAME` to return information about the `Person` table in the `AdventureWorks2012` database.
7171

72-
```
72+
```sql
7373
-- Uses AdventureWorks
7474

7575
SELECT PARSENAME('AdventureWorksPDW2012.dbo.DimCustomer', 1) AS 'Object Name';
@@ -106,7 +106,8 @@ Server Name
106106
(1 row(s) affected)
107107
```
108108

109-
## See Also
109+
## See Also
110+
110111
[QUOTENAME (Transact-SQL)](../../t-sql/functions/quotename-transact-sql.md)
111112
[ALTER TABLE (Transact-SQL)](../../t-sql/statements/alter-table-transact-sql.md)
112113
[CREATE TABLE (Transact-SQL)](../../t-sql/statements/create-table-transact-sql.md)

0 commit comments

Comments
 (0)