Re: How to Set Datetime on SQL 2000 server

Tech-Archive recommends: Speed Up your PC by fixing your registry



I suggest you fix the app so it uses parameterized queries and you won't have this problem. Or at least pass language neutral datetime formats to SQL Server (http://www.karaszi.com/SQLServer/info_datetime.asp).

If above can't be done, then you can make sure that the login used by the app has a language with the desired format (see sp_defaultlanguage and sp_helplanguage).

--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi


"Yuggie" <Yuggie@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message news:355DCF6B-C394-405A-8B2D-4D882345A7B1@xxxxxxxxxxxxxxxx
Hi, everyone,

I have a intranet base on asp language. The site used a SQL 2000 DB on
Windows 2000 server.

I recently migrate the intranet on a Windows 2003 server(Australian region
settings), but still use the SQL server on the old Win2000 box. I found out
when a user key in a date on the intranet like 15/10/2007, the value can not
be saved to the SQL server because SQL read it in US format(mmddyyyy). I then
migrated the SQL server into the same Win2003 server box. The error can't be
fixed.

I compared both Win2000 and Win2003, they both are Australian date format. I
did some googling,quite a lot of people recommend using a command "SET
DATETIME dmy" to fix it. The default datetime format in SQL is US format
type. The value of the date in current SQL table is date type and 8 digits in
length.

Since I only have a little knowledge on SQL server and asp language. I need
to make change on the intranet as less as possible. So I used this method.
But I don't know where and how to apply this settings. I ran a query analyzer
and keyed in the command like:

SET DATETIME dmy
GO

It didn't report any error but couldn't fix the error.

Could anyone give me the instruction please?

Thanks for your time!

Yuggie

.



Relevant Pages

  • Re: Inserting regional settings specific data into sql server
    ... All EU countries withouth the two English speaking use the format dd-MM-yy ... By using the parameters, while the program is in the right culture setting, ... than all those formats results using SQLparameters in the way the SQL server ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Inserting regional settings specific data into sql server
    ... Italianyou will observe that the settings used are 10/02/2006 ... it a better idea to Format it using the string format functions or a very ... into the sql database.Sorry to bug the shorts off you but u now have context ... By using the parameters, while the program is in the right culture setting, ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: How do I convert my dates to string in ADO
    ... and then format it the way I want it in the ... is easier to use Sql To do this. ... Microsoft SQL Server, ... file from a .CSV file which happens to be a report. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Moving a VBA function to SQL server
    ... SQL is a set-based language. ... "String Functions " in Books Online. ... This will produce a job header formatted like this: ... The format he specifies is stored in table 'Settings' - field 'JobHdrMask' ...
    (comp.databases.ms-access)
  • Re: Prepare, SQL query with to_date call
    ... SQL query with to_date call ... The Oracle ODBC driver has a problem with date parameters although I'm ... using a date format containing the RR format. ...
    (perl.dbi.users)