title | description | author | ms.author | ms.reviewer | ms.date | ms.service | ms.subservice | ms.topic | f1_keywords | helpviewer_keywords | dev_langs | monikerRange | ||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
sp_validname (Transact-SQL) |
Checks for valid SQL Server identifier names. |
VanMSFT |
vanto |
randolphwest |
08/24/2023 |
sql |
system-objects |
reference |
|
|
|
=azuresqldb-current || >=sql-server-2016 || >=sql-server-linux-2017 || =azuresqldb-mi-current |
[!INCLUDE SQL Server SQL Database]
Checks for valid [!INCLUDE ssNoVersion] identifier names. All nonbinary and nonzero data, including Unicode data that can be stored by using the nchar, nvarchar, or ntext data types, are accepted as valid characters for identifier names.
:::image type="icon" source="../../includes/media/topic-link-icon.svg" border="false"::: Transact-SQL syntax conventions
sp_validname
[ @name = ] N'name'
[ , [ @raise_error = ] raise_error ]
[ ; ]
The name of the identifiers for which to check validity. @name is sysname, with no default. @name can't be NULL
, can't be an empty string, and can't contain a binary-zero character.
Specifies whether to raise an error. @raise_error is bit, with a default of 1
, which means that errors are displayed. 0
causes no error messages to appear.
0
(success) or 1
(failure).
Requires membership in the public role.