|
database
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
|
What the heck does sysname do? There is nothing in the documentation besides
saying "its a system name"... that doesnt tell me much at all. thanks! Sysname is a system-supplied user-defined datatype. It's a synonym for
nvarchar(128) and is appropriate for SQL Server identifiers, like object and column names. -- Show quoteHope this helps. Dan Guzman SQL Server MVP "Brian Henry" <nospam@nospam.com> wrote in message news:%23tKFfLvEGHA.2184@TK2MSFTNGP10.phx.gbl... > What the heck does sysname do? There is nothing in the documentation > besides saying "its a system name"... that doesnt tell me much at all. > thanks! > And it moves your code towards being self-documenting which I'm all for ie if
you have a SYSNAME column you're saying "I'm going to store an object name which has to meet the rules for SQL identifer in here" so it's more meaningful than an NVARCHAR(128). Damien Show quote "Dan Guzman" wrote: > Sysname is a system-supplied user-defined datatype. It's a synonym for > nvarchar(128) and is appropriate for SQL Server identifiers, like object and > column names. > > -- > Hope this helps. > > Dan Guzman > SQL Server MVP > > "Brian Henry" <nospam@nospam.com> wrote in message > news:%23tKFfLvEGHA.2184@TK2MSFTNGP10.phx.gbl... > > What the heck does sysname do? There is nothing in the documentation > > besides saying "its a system name"... that doesnt tell me much at all. > > thanks! > > > > > I had some code back in the 6.5 days where I used varchar(30) for storing table names etc. Then 7.0
came and changed the rules, so I had to go update my code. If I would have used sysname from the beginning, I would have saved me a few hours of coding and testing. (Not that I expect this to change in a bunch of releases, if ever. :-)) -- Show quoteTibor Karaszi, SQL Server MVP http://www.karaszi.com/sqlserver/default.asp http://www.solidqualitylearning.com/ Blog: http://solidqualitylearning.com/blogs/tibor/ "Damien" <Dam***@discussions.microsoft.com> wrote in message news:4E871DAB-3431-44E2-BD1B-03D806CC4F39@microsoft.com... > And it moves your code towards being self-documenting which I'm all for ie if > you have a SYSNAME column you're saying "I'm going to store an object name > which has to meet the rules for SQL identifer in here" so it's more > meaningful than an NVARCHAR(128). > > > Damien > > "Dan Guzman" wrote: > >> Sysname is a system-supplied user-defined datatype. It's a synonym for >> nvarchar(128) and is appropriate for SQL Server identifiers, like object and >> column names. >> >> -- >> Hope this helps. >> >> Dan Guzman >> SQL Server MVP >> >> "Brian Henry" <nospam@nospam.com> wrote in message >> news:%23tKFfLvEGHA.2184@TK2MSFTNGP10.phx.gbl... >> > What the heck does sysname do? There is nothing in the documentation >> > besides saying "its a system name"... that doesnt tell me much at all. >> > thanks! >> > >> >> >> |
|||||||||||||||||||||||