SQL Server Bug In Handling Of Getutcdate() During DST Time Change?
Nov 6, 2006
During this latest time change, the value of getutcdate() was offset by one hour as called from SQL Server. True UTC time should never be impacted (or changed) by any Daylight Savings Time activity. This is likely not an OS issue, since IIS logs did show the correct UTC time (unchanging) during the DST time change.
Here is a record of how the time change was handled by a running SQL 2000 sp4 Server as these functions were called:
getutcdate() = Oct 29 2006 5:50AM //ran at the same time as// getdate() = Oct 29 2006 1:50AM
getutcdate() = Oct 29 2006 7:05AM //ran at the same time as// getdate() = Oct 29 2006 2:05AM
@@Version=Microsoft SQL Server 2000 - 8.00.2040 (Intel X86) May 13 2005 18:33:17 Copyright (c) 1988-2003 Microsoft Corporation Standard Edition on Windows NT 5.2 (Build 3790: Service Pack 1)
This may seem a simple question, but are there specific precautions that should be fundamentally taken when resetting the time between two SQL servers that replicate?
So I inherited an application that currently serializes it's data to/from XML. I have started on the path down to using SQL CE instead.
Because we need to work across time zones, we like to store all our times as UTC, with occasional exceptions. I was looking forward to simplifying some of my code, and use GETUTCDATE() inside my INSERT/UPDATE queries instead of instantiating datetime objects in code and passing them in as parameters. Imagine my surprise when I discovered that there ain't no such function (which I use all the time on the server end of our application)!
Am I really the first person to wonder about this ?
Can we please get GETUTCDATE() ? Of all the potential feature requests, this would have to be one of the most trivial to implement
I am testing out VS2008, .NET CF 3.5, and SQL CE 3.5 using Merge Replication with SQL 2005 Server. I am getting an error when SQL CE attempts to subscribe to the publication that says SQL CE 3.5 doesn't recognize the function getutcdate(). In the publication there are some tables that have row insert timestamp columns which have getutcdate() listed as the default value.
This error was never a problem under SQL CE 3.0, am I correct in guessing that it is the default value of these row insert timestamp columns that SQL CE 3.5 is complaining about, and if so, what has changed and is there any way around it short of removing the default values from these columns?
I have two columns in Informix data base One has Data Type of date and another column of data type string. Time is stored in string format. I have to Validate wether both are correct, not null, greater than 1753 and concate to get one datetime field to transfer to SQL Server. Right now I am doing it in script component, as I need to log error if any thing is wrong Is there any better way to do it,(derived column or any other component) so that I can log the error also.
I have an event log table with a key-column type of datetime. The value in the key column is configured such as the default value is GETUTCDATE() that way everytime I get a new event the table timestamps it automatically. The problem is, the default format for my datetime column does not include milliseconds. Events can happen during the same second generating duplicated primary keys. Is there an easy way to format the datetime column so it includes millisencods for GETUTCDATE() ?.
Below is my error msg. I am trying to save updates made to a table in the designer. my connection time out is set to 0 but i am still getting this msg:
'Detail' table - Unable to modify table. Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.
Hello, is there a way to set the database to my local time? I am having troubles using the Membership.GetNumberofUsersOnline method - it is showing users online who in test mode I have logged off, but I think due to time zone difference between my server and myself, still appear logged on. This is causing further difficulties in using my admin functions to edit user information, because for some reason I cannot edit a user who is logged on... Help anyone?
Hai,Here is a query that i am creating a tablecreate table test10 (item varchar(10),state bit)now at the time of insertion i will enter like thisinsert into test10 values ('book' ,1)but at the time of display in the table i wantitem statebook truefrom above i want to ask that when i am going to insert 1 i want toget true and 0 as false.I never enter true or false in the insertcommand. please help me in coding.thankyou,lucky.Reply
Would it be possible to change the date time from varchar to datetime. it currently showing as varchar in the following format 20080401 0845 can it be changed to date/time format into something like this 01/04/2008 08:45. If someone could help that would be great. Many thanks
The format of execution time is as below: 6/17/2008 4:43:07PM. Is it possible to change the format of execution time into the following format: 17/06/2008 16:43:07 ???? Thanks....
Prior to insert (into #JobListTable) I need to change the value of the 't2.plant_id' column (from #EquentialJobListTable). This column will have a value of 110, 300 or 320. If 110 then value should be SBGB2, if 300 then values should be RGWP and if 320 value should be RGWP. Is this possible to do?
INSERT#JobListTable ( job_date, job_number, job_phase, qty_received, plant_id ) SELECTt2.job_date, t2.job_number, t2.job_phase, t2.qty_received, t2.plant_id FROM#EquentialJobListTable AS t2 LEFT JOIN#JobListTable AS t1 ON t1.job_date = t2.job_date AND t1.job_number = t2.job_number AND t1.job_phase = t2.job_phase WHEREt1.job_date IS NULL
I created a Time table using BIS. I found that the default naming of time members is too long and redundant.
For example, the wizard generated "Fiscal Calendar 2015", "Fiscal Quarter 1, 2015", etc. However, shorter expression like "FY2015", "FQ1 2015", etc would be enough for me.
Is it possible to change the default naming rule, or does SSAS works correctly if I update the Time table values using SQL?
I am using Sql REporting Services 2005 for viewing reports in my web application. I have to change the chart types at run time basesd on the option. User can select any chart eg. bar chart, pie chart, column chart etc. On selection screen should populate the chart type. I am not able to change chart type at runtime. Help please.
Hi, I am using SQL Server2005 for SSIS. I want to change the source connection dynamicaly evertime. Let me clear, I have to extract some column from excel to MS-Access. I am using Data Flow Task and able to successfully complete the job. But problem is that, whenever a new file comes , i must have to reconfigure my Excel Source. All the time column in file are same, so no need to worry about mapping but how can my package select a file automatically. I have a directory, suppose "C:dpak". I should able to pick the filename and sheet name from this directory every time when my package will execute.
I am using sql reporting services 2005 for viewing my reports, Now i want to change chart type of my report according to diffrent selection, there will be pie chart, coulmn chart , bar chart or many more options resides in my web application and according to user selection , chart of that report should be change.
I Create a measure group and two dimensions using [AdventureWorksDW2012], I try to change one dimension's storage mode with setting property proactive caching as Real-Time ROlap. There is no any warning message when deploying and processing, but error occurs when I query in sql server analysis services, see below for the error messages and the screen capture.
Error occurred retrieving child nodes: the current operation was cancelled because another operation in the transaction failed.
Hello, I want the server to check validation rules and not the user application is this possible??? I want to send my own messages to the user and dont want the user to see the servers messages. Thank you in advance Eran
Hi I think by virtue of not being able to find reference to this I have my answer however.... You trap an error, check it and know that you are happy with it - it isn't an issue. Is it possible to prevent that specific error (number, message - the lot) being passed to the client so developers don't need to handle the error a second time? Ta db chucks :D
I have a field in one of my tables called renew_date. The renew_date is always the first of every month. My requirement is to have a query that's run on the first of every month to select records that have renew_date coming up in the next 150 days.(5 months from today).
I'm thinking of storing a lot of images, Word documetns, PDF, and emails as media in SQL Server 2005. Is it equiped to handle a lot of media? Or is it still preferred to store media separately on a file server?
I am trying to handle exceptions using try catch with remote database.
I am writing the following code which works fine if login locally but when I am trying to do the same on linked server its not being caught in try..catch block.
The procedure I am writing to raiserror
create proc CustomError as RAISERROR ('db error', 16, 1);
I am calling the above procedure in local database using following code
BEGIN TRY exec CustomError END TRY BEGIN CATCH select ERROR_MESSAGE() as ERROR_MESSAGE; END CATCH; GO
and it works perfectly. I am able to catch the error in catch block.
and i m getting the following result db error
but when i am trying to do the same on linked server the code doesn't take me to catch block. I am getting following error while executing the code
go BEGIN TRY exec [192.168.0.50].[BM].dbo.CustomError END TRY BEGIN CATCH select ERROR_MESSAGE(); END CATCH; GO
where [192.168.0.50] is a linked server name and BM is the database name and custom error is my sp which is on remote server.
its giving me following error
Msg 50000, Level 16, State 1, Procedure CustomError, Line 11 db error
I'm creating a class that will wrap a SqlException and will offer the developer a way of determining how to proceed in handling the exception by offering a suggestion of retrying, revalidating the data, and/or calling the entire process a no go.
One of the ways i've come up with to accomplish this is by using the severity (SqlException.Class) to assist in making a suggestion to the developer.
I'm hoping to get some feedback from the developers who use this forum if they feel severity is or is not the way to go, and also to offer any other ways of accomplishing that they can come up with.