November 4, 2006 at 11:58 am
Hello all,
I have an application that inserts dates in dmy format into a database. Currently, the application is set to insert this date as a string, convert it to a datetime and finally insert it into a datetime field. This process takes place by setting the date format to dmy by using SET DATEFORMAT 'dmy'.
I would like to eliminate all this process and be able to insert the dates directly to the corresponding field. Is there a way to change the default dateformat permanently at the database level?
Thanks.
November 4, 2006 at 12:41 pm
I'm not exactly sure what you are asking.
Check your servers language setting
From Books Online
Microsoft® SQL Server™ 2000 is installed with 33 natural languages defined on the server. The definitions for each language establish how date data is interpreted:
These language definitions are stored in master.dbo.syslanguages and a language identifier (ID) identifies each language.
Each instance of SQL Server uses a default language for all connections to the server. For more information about configuring the setting, see default language Option.
Most connections use the default language configured for the server, but each connection can individually set a SQL Server language to be used for the connection:
Microsoft ActiveX® Data Object and OLE DB applications can include the Language keyword in a provider string specified when they connect.
SQL Server supports having multiple, language-specific copies of the error messages stored in master.dbo.sysmessages. All instances of SQL Server contain the set of English messages. SQL Server is localized, or translated, into French, German, Spanish, and Japanese versions. Installations of localized versions of SQL Server install the translated set of messages in addition to the English set. When SQL Server sends a message to a connection, it uses the localized message if the language ID of the connection matches one of the language IDs present in sysmessages. If there is no message in sysmessages with the same language ID, the English version of the message is sent.
November 5, 2006 at 1:35 am
Since I don't have access to changing the server settings, I was looking into changing the dateformat setting only for one database. This gave me the answer. I am simply including the language setting in the connection used by the application.
Thank you.
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply