Re: How to Set Datetime on SQL 2000 server
- From: "Tibor Karaszi" <tibor_please.no.email_karaszi@xxxxxxxxxxxxxxxxxx>
- Date: Sat, 13 Oct 2007 10:56:52 +0200
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
.
- Follow-Ups:
- Re: How to Set Datetime on SQL 2000 server
- From: Yuggie
- Re: How to Set Datetime on SQL 2000 server
- Prev by Date: Re: SQL Server 2005 Express SP2 and SQL Server Standard Edition
- Next by Date: Upgrade to SqlServer 2005 64bit
- Previous by thread: Re: How to Set Datetime on SQL 2000 server
- Next by thread: Re: How to Set Datetime on SQL 2000 server
- Index(es):
Relevant Pages
|