Monday, August 31, 2009

"Arithmetic overflow error converting expression to data type datetime.Native error: 8115 SQLState: 22003" error message in Microsoft SQL

Problem Description: Following error message may be thrown by some applications that uses date formats:

"Arithmetic overflow error converting expression to data type datetime.Native error: 8115 SQLState: 22003"

A application that was working properly earlier can certainly start to throw this error message after some changes were made to the environment. In my usercase a database was moved from one SQL server to another SQL server. Problem started to occur on 13th of month, problem was present till 1st of next month. Problem will come back on 13th of next month.

Cause: Date formats used by service account can cause problem while converting data that is related to calander dates. In my usercase default language for Service Account within Microsoft SQL Server has been changed from one format to another e.g. from English (US_English) to British.


Solution: There are different solutions for it but if a application is already wrote and you only want to resolve the problem of error message following is what you can try.

Note: These steps are written for MS SQL Server 2005 you might want to change it a little for other versions of MS SQL Server
  1. Log on to SQL server that hosts databases in question.
  2. Launch 'SQL Server Management Studio'.
  3. When prompted, log on using the credentials that will allow you to make changes to the SQL server configuration.
  4. In the left pane of 'Microsoft SQL Server Management Studio' expand 'Security' section.
  5. Further expand 'Logins' section.
  6. Select Service Account and right click on it.
  7. Select 'Properties'
  8. On 'Login Properties' screen on right side of the pane check 'Default Language' section.
  9. If 'Default Language' is set to British change it to English (or vise versa depending on your needs)
  10. Select 'OK'

Language and dateformats specific for a service account can also be checked by running 'dbcc useroptions' query analyzer while logged in using service account .

Caution: Please also check with the vendor of the application on what date format is preffered by the application as making changes to date format settings can cause problem with the data that will be stored by service account into the SQL tables.


Tuesday, August 18, 2009

How to install ADSIEdit on Windows 2008 server ?

As many of us have used ADSIEdit in different versions of Windows Platforms, I am sure we all would like to know where ADSIEdit is located in Windows 2008 Server ?

In Windows 2008 ADSIEdit is part of Remote Server Administration Tools (RSAT).

Following are methods to get it installed:

Method one:
1. Open command prompt
2. Run command line 'ServerManagerCmd -i RSAT-ADDC'
3. Once installed you should be able to find it under Administrative Tools

Method two:
1. Open 'Server manager'
2. Select 'Features'
3. Select 'Add Features' on the right side of the pane
4. Select 'Remote Server Administration Tools'
5. Make sure you tick 'Active Directory Lightweight Directory Services Tools'
6. Follow the prompt to install (Select Next)
7. Once installed you should be able to find it under Administrative Tools







How to install .NET Framework on Windows 2008 server?

Following are steps on how to install .NET Framework on Windows 2008 Server

1. Open 'Server Manager'
2. Select 'Features'
3. Right click on Features
4. Select 'Add Features'
5. Select '.NET Framework 3.0 Features'
6. Follow the prompt (Select Next)
7. Once installed select 'Close'

Now you machine is ready with .NET Framework 3.0