Wrox Programmer Forums
Go Back   Wrox Programmer Forums > SQL Server > SQL Server 2005 > SQL Server 2005
|
SQL Server 2005 General discussion of SQL Server *2005* version only.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server 2005 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 18th, 2007, 04:05 PM
Friend of Wrox
 
Join Date: Apr 2006
Posts: 160
Thanks: 0
Thanked 0 Times in 0 Posts
Default time in sql server is not real time

Hi,

when i create a new user in a .MDF file, the hour of creation in the field
"createdate" of table "membership" is exactly 2 hours less than the time of
my computer. Probably something to do with different hours between Europe
and UK or ...

How can i set the creation hour to exact the same hour of my computer?

Thanks
Dan


 
Old April 18th, 2007, 11:55 PM
Friend of Wrox
 
Join Date: May 2006
Posts: 246
Thanks: 0
Thanked 0 Times in 0 Posts
Default

UK is not resided in Europe? ;)

Look at the code. Are you using CURRENT_TIMESTAMP, GETDATE() or any UTC-related function?


 
Old April 19th, 2007, 02:12 AM
Friend of Wrox
 
Join Date: Apr 2006
Posts: 160
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi, thanks for replying

I meant: UK is not part of the continent ... and there is a difference of two hours between UK and the continent.

I don't use any function. The user is created using asp.net control CreateUserWizard. The user enters his name, password etc ... and it's done.

 
Old April 19th, 2007, 05:02 AM
Friend of Wrox
 
Join Date: May 2006
Posts: 246
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Which component is writing the CREATEDATE column then?
The SQL Server get it's date and time from the server on which it is installed.
Your computer may have different settings.


 
Old April 19th, 2007, 07:03 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

Is the Column set a default value at the DB level, or is that sent from the .net application? If sent from the .net application then the time settings (2 hours lag) of the application system might be different from what the DB server has.

Have check on that.
Cheers.

_________________________
- Vijay G
Strive for Perfection
 
Old April 19th, 2007, 07:03 AM
Friend of Wrox
 
Join Date: Apr 2006
Posts: 160
Thanks: 0
Thanked 0 Times in 0 Posts
Default

The test i did (creating an user in sql server via asp.net) happened on the computer with Sql server. The settings (region, language) of that computer are correct because the clock and date are correct on my screen.
I still don't understand why sql server doesn't use that date /time and wonder which setting it uses.

 
Old April 19th, 2007, 07:07 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

What does "select getdate()" return on the sql server? Is there a lag of 2 hours in that? If there is a lag you might want to fix it at the sql server computer.
Otherwise...
Why dont you try setting default value for that column in the sql server and see if that helps. Then you might remove the code that sets user creation date from the application.

_________________________
- Vijay G
Strive for Perfection





Similar Threads
Thread Thread Starter Forum Replies Last Post
Real time data from network Nuwang .NET Framework 2.0 1 May 13th, 2008 04:34 PM
Real Time Application of Void class pandian Java Basics 0 October 9th, 2006 05:36 PM
real time updation on a offline database. deadman ADO.NET 3 April 17th, 2006 04:29 PM
Real Time Calculations on Form losartan Access 10 February 10th, 2005 11:47 AM
real time calculations jman11587 Javascript How-To 4 June 29th, 2003 07:15 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.