June 13, 2012

sp_validname (Transact-SQL MetaData) Definition

Please note: that the following source code is provided and copyrighted by Microsoft and is for educational purpose only.
The meta data is from an SQL 2012 Server.

I have posted alot more, find the whole list here.

Goto Definition or MetaData

Definition:

sys.sp_validname(bit @raise_error
, nvarchar @name)

MetaData:

   
-- -- -- -- -- -- -- -- -- -- -- -- -- -- sp_validname -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
CREATE PROCEDURE sys.sp_validname
@name sysname,
@raise_error bit = 1
AS
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -
-- Check for valid SQL-Server identifiers: All non-binary-zero
-- characters are valid. String must not be null or empty.
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -
-- QuoteName() will be non-null only if no null-characters. Also check length.
IF (quotename(@name) is not null AND datalength(@name) > 0)
RETURN (0)

-- Bad Name
if @raise_error = 1
raiserror (15004,-1,-1)
return (1) -- sp_validname

No comments:

Post a Comment

Total Pageviews