Wednesday, March 7, 2012
Datetime changes when insert
I have one table with data that has two datetime columns. I also have an empty table that is i copy of the first (ie identical design) + one column, that I want to move some rows to.
When I do the insert into the empty table the datetime fileds are converted from '2004-01-01' to 'Jan 1 2004 12:00AM' WHY!!!
I hate this kind of problems... I haven't told it to convert, and besides it adds a time too...
Anyone got a solution or explanation for this, please?I don't think it's been converted. It's just the way you display it. The value stays the same.
Tuesday, February 14, 2012
DATEADD Function
Problem:
I have two nearly identical querys that are running. One of the query's is using the SQL DATEADD function. These query's are running on a SLQ2005 MSDE. There is now service pack four applied to this server.
The question is:
Are there any known issues with the DATEADD function in SQL 2005? This query is used in a report that has been in use for about two years. There were some changes made to the server (BIOS upgrade) including adding this service pack. These changes did not cause any other SQL issues. This query now takes almost five minutes to run. The nearly identical query (the difference is the date is passed in as a parameter rather than using the DATEADD function) takes from one to two seconds. These reports have a history of nearly identical running time.
What is a good way to try and correct the issue or at least to try and isolate the problem? Have there been any known issues with this function?
Thanks for any help!
It will be much easier to help if you post the query.
|||Can you just clarify- are you using SQL2000 SP4 or running SQL2005 Express?
I am not aware of any issues with DATEADD. To help further could you post the queries that are running and any DDL statements.
Thanks