SQL Server Q&A

As a software engineer, I focus on .NET, especially asp.net, C#, WCF and so on, and I am also very interested in Search Engine Optimization.

Entries Tagged ‘name’

FIX: DB-Library sp_cursor Fails with Error Message 16933 if Bracketed Identifiers are Passed with the Tablename Parameter

Symptoms
When you use the DB-Library API server cursors, if the table name parameter that is passed to the sp_cursor stored procedure includes a bracketed identifier, the execution of sp_cursor fails with the following error message:

SQL Server message 16933, state 2, severity 16:
The cursor does not include the table being modified or the table is not updatable through the cursor.Refer to the “More Information” section of this article for an example and additional symptoms.
Resolution
SQL Server is unable to successfully parse the bracketed table name with spaces.
DB-Library binds the table name as a SQLCHAR data type, which has a fixed length of 255 characters (the maximum length of this data type). The buffer holds the table name, including the brackets, with the remaining bytes padded with spaces.

FIX: Configuration Fails Pasting Distributor Database Name with a Leading Space

Symptoms
In the Configure Publishing and Distribution Wizard, if you select the option to customize the settings rather than accept the default values, you are given the opportunity to change the distribution database name from its default of “distribution.” Although you cannot type a space character in the Distribution Database Name box, it does accept a space character if you copy a text string (for example, “my database”) to the clipboard and paste it in.
If the name you use contains a space character, the database is still created. However, if the name that you paste in begins with a space character (for example, ” my database”), the wizard fails with the following error message:

SQL Server Enterprise Manager could not configure ’server_name’ as the distributor for ’server_name’.
Error 14262: The specified @database_name (‘db_name’) does not exist.
Resolution
To work around this problem:do not use spaces in the name
-or-
make sure that the database name you are pasting in does not contain a leading space character.

Error message when you try to set a witness in a database mirroring session in SQL Server 2005: “The ALTER DATABASE command could not be sent to the remote server instance ‘TCP://<ServerName&g …

Symptoms
Consider the following scenario:You have a database mirroring session in Microsoft SQL Server 2005. The database mirroring session does not have a witness. You set up a witness server. On the principal server and on the witness server, you do not use DNS together with DHCP for name resolution. Instead, you specify that a host file should be used for name resolution. On the principal server instance, you try to set the witness.In this scenario, you receive the following error message:

Msg 1456, Level 16, State 3, Line 1
The ALTER DATABASE command could not be sent to the remote server instance ‘TCP://ServerName:port’. The database mirroring configuration was not changed. Verify that the server is connected, and try again.
Resolution
A database mirroring session must use a fully qualified domain name (FQDN) to resolve the name of the witness server.

Error message when you install SQL Server 2005 Express Edition Service Pack 1 in Windows Vista: “Windows NT user or group ‘<COMPUTERNAME>\SQLServer2005MSSQLUser$<COMPUTERNAME>$MSSQLSE …

Symptoms
When you try to install Microsoft SQL Server 2005 Express Edition Service Pack 1 (SP1) on a computer that is running Windows Vista, you receive the following error message:

SQL Server Setup failed to execute a command for server configuration. The error was [Microsoft][SQL Native Client][SQL Server]Windows NT user or group ‘COMPUTERNAME\SQLServer2005MSSQLUser$COMPUTERNAME$MSSQLSERVER’ not found. Check the name again.. Refer to the server error logs for detailed error information.
Resolution
This problem occurs if the following conditions are true:The Windows Vista-based computer has a name thatconsists oflowercase characters or that consists of a mixture of lowercase characters and uppercase characters. For example, the computer name resembles Workstation-1.You specify a case-sensitive collation setting for the SQL Server service when you install SQL Server 2005 Express Edition SP1.Windows Vista uses the following two methods to return the computer name in response to a request for the computer name:Windows Vista can return the computer name in uppercase characters.Windows Vista can return the computer name in the actual mixed case characters that appear in the System Properties dialog box.During one part of the installation of SQL Server 2005 Express Edition, theSetup programrequests the computer name as mixed characters. However, Windows Vista returns the computer name in uppercase characters instead. The Setup program also requests the computer name in other parts of the installation of SQL Server 2005 Express Edition. Windows Vista may then return the computer name in mixed case characters.
The SQL Server 2005 Express Edition Setup program compares the received computer names. Generally, this does not cause a problem because computer names are not case sensitive in Windows Vista. However, if a case-sensitive collating sequence is specified when you install SQL Server 2005 Express Edition, the result of the name comparison between the computer name in uppercase characters and the computer name in mixed case characters fails. Therefore, the installation of SQL Server 2005 Express Edition SP1 is unsuccessful.

DSN network library shown as “Other” in ODBC Administrator

Symptoms
When creating a new SQL Server Data Source Name (DSN) using the ODBC API SQLConfigDataSource function, a network library must be specified. If the network library name is in lowercase letters, the Client Configuration dialog box may show it as “Other”.
Resolution
In Control Panel, the Client Configuration dialog box in ODBC Data Source Administrator is case-sensitive. It compares the network library name from the registry to uppercase network library names. See the “More Information” section for information on the registry entries that are affected by SQLConfigDataSource.

Description of names and IP addresses that an MSDTC client in a cluster environment must have

Symptoms
The purpose of this article is to help you in the setup or in the troubleshooting of a configuration for a COM+ Application Server or a configuration for an Internet Information Server (IIS) computer that interacts with a clustered server that uses Microsoft Cluster Server (MSCS) that is behind a firewall.
You may have one of the following scenarios: COM+ or IIS computer (client computer)SQL Server clustered that uses MSCSMicrosoft Distributed Transaction Coordinator (MSDTC) as a clustered resource in its own resource group (own name and IP address)Cluster and client computer that are separated by a firewall Certain Internet Protocol (IP) addresses and their corresponding network names must be known by the client computer for MSDTC to work correctly. The client computer can resolve the following names and the following IP addresses by using Domain Name System (DNS), hosts file, or another name resolution method: MSDTC resourceAn instance of SQL Server if the cluster configuration is either active-passive or active-activeCluster Name Certain IP addresses and their corresponding network names must be known by the nodes in the cluster for MSDTC to work correctly. Both nodes in the cluster can resolve the client computer name to an IP address by using DNS, hosts file, or another name resolution method.
Resolution
Additionally, the firewall must be configured to allow bidirectional traffic to occur between the client computer and the cluster. The firewall rules must include the following: The IP network names and the addresses of both physical nodes on the clusterThe SQL Server Instances network names and addressThe client network name and addressesThe child network name and IP resource of the MSDTC Resource Firewall rules must include the range of IP ports that are defined in the registry to allow traffic. See the “References” section.
You may also have to open an additional range of available IP ports as a requirement for the cluster server. See the “References” section for more information.