Max length of SQL Server instance name?

后端 未结 4 943
死守一世寂寞
死守一世寂寞 2021-02-05 13:18

I need to know the maximum character length for the name of an instance of a SQL Server for the following versions (if there is a difference between them.)

  • SQL Ser
相关标签:
4条回答
  • 2021-02-05 13:24

    Instance names for SQL Server are limited to 16 characters

    http://msdn.microsoft.com/en-us/library/ms143531(v=SQL.105).aspx

    It doesn't list SQL Server 2000 online but looking at the BOL that I have installed for SQL Server 2000 it is also limited to 16 characters.

    SQL Server 2000 - Books Online

    EDIT

    Use this screen to add and maintain instances of Microsoft® SQL Server™ 2000.

    Options

    Default

    • When selected, a default instance of SQL Server 2000 is installed. Click Next to proceed with the install process.

    • When cleared, you can install or maintain a named instance of SQL Server 2000.

      Note If this check box is not enabled, Setup has detected a default instance of SQL Server on this computer. The default instance could be an installation of SQL Server 6.5, SQL Server version 7.0, or it could be the default instance of SQL Server 2000, already installed. Only one installation of SQL Server, any version, can be the default instance at any one time. For more information, see Multiple Instances of SQL Server.

    Instance Name

    Enter a new instance name, or the name of the instance to maintain. Review and follow the rules for instance names.

    Important It is recommended that instance names be kept to less than 10 characters. Instance names can appear in the user interface of various SQL Server and system tools; shorter names are more readable.

    **Instance Naming Rules **

    • An instance name is not case-sensitive.

    • An instance name cannot be the terms Default or MSSQLServer.

    • Instance names must follow the rules for SQL Server identifiers and cannot be reserved keywords.

    • Instance names are limited to 16 characters.

    • The first character in the instance name must be a letter, an ampersand (&), an underscore (_), or a number sign (#). Acceptable letters are those defined by the Unicode Standard 2.0, which includes Latin characters a-z and A-Z, in addition to letter characters from other languages.

    • Subsequent characters can be:

      • Letters as defined in the Unicode Standard 2.0.

      • Decimal numbers from either Basic Latin or other national scripts.

      • The dollar sign ($), a number sign (#), or an underscore (_).

    • Embedded spaces or special characters are not allowed in instance names. Neither is the backslash (), a comma (,), a colon (:), or the at sign (@).

    Warning Only characters that are valid in the current Microsoft Windows® code page can be used in instance names in SQL Server 2000. If a Unicode character not supported under the current code page is used, an error occurs.

    0 讨论(0)
  • 2021-02-05 13:24

    The only instances where I've seen a character limit are for the SQL Server 2012, and that limit appears to be 16 as others have said. I have 2008 and 2008 R2 instances where the name doesn't seem to have been limited (e.g. MSRS10.MSSQLSERVER_2008), but that could just be that I didn't try for anything longer than 23 or 24 characters. I'm sorry this doesn't provide information from docs, but I hope it's helpful.

    0 讨论(0)
  • 2021-02-05 13:40

    My experience in SQL 2008 R2 is:

    Windows Server 2008 R2 NetBIOS has a 15 character limit.

    If you want a SQL Server default instance name beyond this (@@SERVERNAME) then you will have to do the following:

    sp_dropserver 'oldname' go sp_addserver 'newname_greater_than_15_characters','local' go

    Restart the MSSQLService and your new name takes effect. Sysname is the datatype in play with the function and system stored procedures.

    0 讨论(0)
  • 2021-02-05 13:44

    jl: sp_dropserver 'oldname' go sp_addserver 'newname_greater_than_15_characters','local' go I believe this is for the server name and not the instance name.

    0 讨论(0)
提交回复
热议问题