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 ‘Windows’

Error message when you start SQL Server 2005 Management Studio: “Input string was not in a correct format”

Symptoms
When you start Microsoft SQL Server 2005 Management Studio, you may receive the following error message:

Unhandled exception has occurred in your application. If you click Continue, the application will ignore this error and attempt to continue. If you click Quit, the application will close immediately.
Input string was not in a correct format.If you click Detail in the dialog box, the following error message text appears at the top of the details:

See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text **************
System.FormatException: Input string was not in a correct format.
at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal)
at System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info)
at Microsoft.SqlServer.Management.UI.ConnectionDlg.LoginControl.InitFromLastUsedServerType()
at Microsoft.SqlServer.Management.UI.ConnectionDlg.ConnectionDialog.DoOneTimeInitialization()
at Microsoft.SqlServer.Management.UI.ConnectionDlg.ConnectionDialog.OnVisibleChanged(EventArgs e)
at Microsoft.SqlServer.Management.UI.VSIntegration.ShellConnectionDialog.OnVisibleChanged(EventArgs e)
at System.Windows.Forms.Control.WmShowWindow(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.ContainerControl.WndProc(Message& m)
at System.Windows.Forms.Form.WmShowWindow(Message& m)
at System.Windows.Forms.Form.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
Resolution
This problem occurs if the value of the following registry key is not empty or is set to an invalid value:
HKEY_CURRENT_USER\Control Panel\International\sPositiveSign

Error message when you install SQL Server 2005 on a computer that is running the original release version of Windows XP: “This application has failed to start because the application configuratio …

Symptoms
When you install Microsoft SQL Server 2005 on a computer that is running the original release version of Microsoft Windows XP, you receive the following error message:

This application has failed to start because the application configuration is incorrect.
Reinstalling the application may fix this problem.Additionally, the following event is logged in the System log:
Source: SideBySide
Event ID: 59
Description:
Resolve Partial Assembly failed for Microsoft.VC80.CRT. Reference error message: The system cannot find the file specified.
Resolution
This problem occurs because SQL Server 2005 requires the GetSystemTimes function. The GetSystemTimes function is included in Windows XP Service Pack 1 (SP1) and inlater Windows XP service packs.

Error message when you install SQL Server 2005 on a computer that is running the original release version of Windows XP: “This application has failed to start because the application configuratio …

Symptoms
When you install Microsoft SQL Server 2005 on a computer that is running the original release version of Microsoft Windows XP, you receive the following error message:

This application has failed to start because the application configuration is incorrect.
Reinstalling the application may fix this problem.Additionally, the following event is logged in the System log:
Source: SideBySide
Event ID: 59
Description:
Resolve Partial Assembly failed for Microsoft.VC80.CRT. Reference error message: The system cannot find the file specified.
Resolution
This problem occurs because SQL Server 2005 requires the GetSystemTimes function. The GetSystemTimes function is included in Windows XP Service Pack 1 (SP1) and inlater Windows XP service packs.

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.

BUG: Restore of a Large Database on Windows 98 May Fail with 3257 Error Message

Symptoms
Restoring a database backup on Microsoft Windows 98 fails if all the following conditions are met:The file size of the restored database is 2 GB or greater.
The database is being restored over an existing database that is less than 2 GB even if there is more than 2 GBs of free disk space.Here is an example of the error message that might occur:

Server: Msg 3257, Level 16, State 1, Line 1
There is insufficient free space on disk volume ‘D:\MSSQL7\DATA’ to create the database. The database requires 2352873472 additional free bytes, while only 2147155968 bytes are available.
Server: Msg 3013, Level 16, State 1, Line 1
Backup or restore operation terminating abnormally.This error message occurred while attempting to restore a 2 GB database over a newly created or existing database that was less than 2 GB. The restored database file (.mdf) would have been 2,352,873,472 bytes in size.
Resolution
On Microsoft Windows 98, a different Win32 function is called to determine how much free space is available. The function that is called returns a maximum of 2 GB free space.
For additional information about the Win32 function, click the article number below to view the article in the Microsoft Knowledge Base:
231497?(http://support.microsoft.com/kb/231497/EN-US/) INF : Understanding and Using GetDiskFreeSpace and GetDiskFreeSpaceEx

Authentication methods for connections to SQL Server in Active Server Pages

Symptoms
Both SQL Server authentication (standard security) and Windows NT authentication (integrated security) are SQL Server authentication methods that are used to access a SQL Server database from Active Server Pages (ASP).
Note This article does not apply to Microsoft Windows 2000 Active Directory domains. The Microsoft Windows NT authentication model that is discussed in this article only applies to Windows NT domains.
Resolution
SQL Server authentication SQL Server authentication relies on the internal user list maintained by the SQL Server computer. This list does not include Windows NT users, and is specific to the SQL Server computer. Users are created and configured using the SQL Server Enterprise Manager. To use this authentication method, perform with the following steps: If you connect through Open Database Connectivity (ODBC), in the ODBC Administrator, choose SQL Server authentication when you configure the data source.In the ActiveX Data Objects (ADO) connection string, include the parameters “UID” and “PWD” when you use ODBC, and “User ID” and “Password” when you use the SQLOLEDB provider. Windows NT authentication The computer running SQL Server enables access to its data through Windows NT accounts. To enable Windows NT authentication, through the Internet Information Server (IIS) computer, Basic authentication must be enabled for the Web application. To do this, perform the following: Start the Internet Services Manager. Browse to the Web site, right-click the Web site, and then click Properties.Click the Directory Security tab, click Edit under Anonymous access and authentication control, and then select the Basic authentication (password is sent in clear text) option. To configure IIS for Windows NT authentication, you cannot use Windows NT Challenge\Response (NTLM) authentication. You must use one of the following two IIS authentication methods: Enable only Basic authentication for the Web application. If users are allowed anonymous access, verify the following: If the user is configured as the Anonymous user in IIS, they must also be configured in a Windows NT account on the computer running SQL Server. If SQL Server and IIS are not on the same computer, create the user as either a domain account accessible to both computers or locally on both the SQL Server computer and the IIS computer with the same password. If you create the user locally on both computers, the user must be given the Log on Locally right on the SQL Server computer. If the user is a domain account, the user must be given “Access this computer from the network” right on the SQL Server computer. If SQL Server and IIS are not on the same computer, then start the Internet Services Manager (on the Directory Security property page for the Web application), open the Anonymous User Account dialog box, disable the Enable Automatic Password Synchronization option, and then manually enter the password for the account.The IIS computer requires the user’s password to generate a security token that remains valid on another server. When the Enable Automatic Password Synchronization option is enabled, a token can only be generated for the local computer.If IIS and SQL Server are on the same computer, the name of the SQL Server data source in the connection string and in the ODBC configuration data source (if applicable) is local. In addition, perform the following steps to connect to a SQL Server computer using Windows NT authentication in ASP: If you connect through ODBC, in the ODBC Administrator, choose Windows NT authentication when you configure the data source.In the ActiveX Data Objects (ADO) connection string, omit the parameters “UID” and “PWD” when you use ODBC, and “User ID” and “Password” when you use the SQLOLEDB provider. If you connect using the OLEDB provider for SQL Server (Provider=SQLOLEDB), the connection string must include “Integrated Security=SSPI.”In the SQL Server Enterprise Manager, add all Windows NT accounts and groups that need access through the integrated security to the logins, and define them as using Windows NT authentication. To simplify administration, Microsoft recommends that you add Windows NT groups instead of individual accounts. Configure permissions to all necessary databases, tables, and stored procedures when you define the account(s). The following error messages indicate problems with the SQL Server configuration for Windows NT authentication:

Microsoft OLE DB Provider for ODBC Drivers (0×80040E4D)
[Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user ‘\’.
Microsoft OLE DB Provider for ODBC Drivers error ‘80040e4d’
[Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user ‘NT AUTHORITY\ANONYMOUS LOGON’.