sql - What are the benefits of storing name as "sysname" instead of "nvarchar(128)"? -


I am looking for a table that will store information about stored procedures SP_Name Need to archive was to use my original plan SP_Name NVARCHAR (128) no null .

By the process I will use the OBJECT_NAME (@@ PROCID) function to get the value for the SP_Name column.

It is not SYSNAME Provide more information about datatype Question only explains what this is, but how it works, additionally answers are about 3 years old And Microsoft has made several upgrades for SQL Server in the 2012 and 2014 editions.

Do I resend SP_Name to SYSNAME over NVARCHAR (128) column? Or should I use proprietary data types that can be omitted or changed in later versions?

is an abstract that shifts you from the details of the implementation. The advantage is that if the definition changes in future versions, then your code will still work correctly.

sysname is done with varchar (30) . If, say, the SQL Server 2016 object identifier allows up to 256 characters, then you do not need to find and update all hardcod 128.

I also like using it because it is used to mean that the data type for the column / variable that stores the object identifiers.


Comments