Why the data type sysname is always in lower case?
ogrishman
Posts: 81 Bronze 4
I have the following code:
I've already configured the keywords to use upper case. You can check my formatting style file here at: https://www.dropbox.com/s/uskhwtq0ecs0a ... ylev2?dl=1
The sysname keyword is always in lower case? Is this a bug?
DECLARE @objectName sysname, @objectType CHAR(2); SET @objectName = N'sysrscols'; SET @objectType = 's'; SELECT * FROM sys.objects WHERE [name] = @objectName AND [type] = @objectType;
I've already configured the keywords to use upper case. You can check my formatting style file here at: https://www.dropbox.com/s/uskhwtq0ecs0a ... ylev2?dl=1
The sysname keyword is always in lower case? Is this a bug?
Comments
This is by design as sysname acts more like a user defined data type than a built-in data type and needs to be lower case for it to be recognised on case sensitive databases.
(From https://technet.microsoft.com/en-us/lib ... 91240.aspx: Important: In databases that are case-sensitive, or that have a binary collation, sysname is recognized as a SQL Server system data type only when it appears in lowercase.)
Thanks,
Aaron.