Re: How to Set Datetime on SQL 2000 server
- From: Yuggie <Yuggie@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Mon, 15 Oct 2007 06:09:01 -0700
Hi, Tibor and Sebastian
Thanks very much for the reply. The solutions sound quite interesting. I
took a good read. But they seems too complicated for me. It is a ASP site
with quite a lots of pages. It will take quite a while to update all pages.
I copied the whole site on another Windows 2003 server with IIS 6 enabled.
Since nothing changed, the site on the new server still links to the same SQL
DB. The asp pages on this new server works fine with all date data. I
checked, both server logon as network service and domain account, regional
settings are both Australian format. The only difference is the current
server is a DC and the new server is a domain server.
As you said, the SET DATETIME is per session base which can't be fixed by
changing SQL configuration. That means I still have to change all asp pages.
Can we find the solution from the regional settings? P.S. the new server is
for test only, I need to uninstall IIS after the testing.
I appreciate your help.
Cheers,
Yuggie
"Tibor Karaszi" wrote:
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: Tibor Karaszi
- Re: How to Set Datetime on SQL 2000 server
- References:
- Re: How to Set Datetime on SQL 2000 server
- From: Tibor Karaszi
- Re: How to Set Datetime on SQL 2000 server
- Prev by Date: SQL Server 2005 SP2 failed with error 29537
- Next by Date: Re: How do I remove my development server log from my client site during login?
- 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
|