Showing posts with label Error Message. Show all posts
Showing posts with label Error Message. Show all posts

2007-10-23

Arithmetic overflow error converting expression to data type datetime

I got this error when I tried to convert string to datetime in query.

This is Culture problem.

What culture is your webserver?
What culture is your ASP.NET application using?
What culture is your database?

This is due to an inconsistency in the language settings between the web server and SQL server (or SQL server user).

By default, SQL Server users are set to "us_english" as the default language. The result is that different date formats are being used and are therefore not recognized by the database.

There are several options to remedy this situation:

1. Change the SQL user's default language to match the language settings on the SQL server.To do this, open SQL enterprise manager and connect to your database server. Expand Security -> Logins and open the properties dialog for the user that you are using to connect to the database. On the main properties page, change the language to equal the same language that is set on your web server.

2. Modify your connection stringOn your SQL connection string, add a parameter of Language= and set it equal to the correct language. For example, Language=British. (www.prezzatech.com)

2007-09-04

Database Engine Tuning Advisor

I found this solution in microsoft web site and it's can resolve the problem.

Error message when you use Database Engine Tuning Advisor in SQL Server 2005: "Attempt to initialize the CRT more than once


When you use Database Engine Tuning Advisor to analyze the performance effects of workloads in Microsoft SQL Server 2005, you may receive the following error message:

R6031- Attempt to initialize the CRT more than once. This indicates a bug in your application.

CAUSE
This problem occurs because of the application compatibility settings. The application compatibility settings may be set separately for the application. Alternatively, the application compatibility settings may be inherited from the settings that are specific to the Explorer.exe process. When you explicitly set the application compatibility settings for the Explorer.exe process, all applications that are started from the Explorer.exe process inherit the same application compatibility settings.

If Database Engine Tuning Advisor inherits the application compatibility settings from the Explorer.exe process, the Microsoft Windows loader tries to initialize the C run-time library (CRT) Msvcp80.dll file two times when you start Database Engine Tuning Advisor. Therefore, Database Engine Tuning Advisor stops responding.

Warning Serious problems might occur if you modify the registry incorrectly by using Registry Editor or by using another method. These problems might require that you reinstall your operating system. Microsoft cannot guarantee that these problems can be solved. Modify the registry at your own risk.

To work around this problem, you must set the Explorer.exe process to stop using the application compatibility technology. To do this, follow these steps:
1. Click Start, click Run, type regedit, and then click OK.
2. Locate the following registry subkey:
HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers
3. In the right pane, right-click the registry entry for the Explorer.exe process, and then click Delete.
4. In the Confirm Value Delete dialog box, click Yes.
5. Exit Registry Editor.
6. Restart the computer.

2007-08-29

Database Limits

Today I try to update some tables in my database and I got the error message about Insufficient Resources and this is a problem.


MSDE Limits

An MSDE database is limited in total size to 2 GB. How quickly you reach 2 GB depends on the number of members you have, the frequency with which you send, how long you keep archives, incoming mail and outgoing mail, and other factors. If you are upgrading from 4.x or lower, and wish to use MSDE, you can determine how large your total database size is by adding together the size of all the files in your db directory.

ListManager will warn you via email if your database is growing too large. If you are running ListManager in the foreground and your database is too large, you'll see a message similar to this one:

severity: 17 - Insufficient Resources - The statement caused SQL Server to run out of resources (such as locks or disk space for the database) or to exceed some limit set by the system administrator.
msgtext: Could not allocate space for object 'members_' in database 'ListManager' because the 'PRIMARY' filegroup is full.

If you find that your database is growing too large under MSDE and are unable to trim its size by managing the length of time data is kept, you should consider upgrading to a stand-alone SQL server.