Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

SQLDateTime overflow Delete issue?

Posted on 2009-07-02
10
Medium Priority
?
271 Views
Last Modified: 2012-05-07
I receive the error: "SqlDateTime overflow. Must be between 1/1/1753 12:00:00 AM and 12/31/9999 11:59:59 PM" when attempting to delete a record in my backend sql server 2005 database??
0
Comment
Question by:Shepwedd
  • 3
  • 3
  • 3
  • +1
10 Comments
 
LVL 75

Expert Comment

by:Aneesh Retnakaran
ID: 24763616
datetime wont support upto 9999 use value upto 2049-12-31
0
 
LVL 75

Expert Comment

by:Aneesh Retnakaran
ID: 24763668
sorry , mymistake it supports   January 1, 1753, through December 31, 9999..  seems like your database constain values that are out of range
0
 
LVL 41

Expert Comment

by:ralmada
ID: 24763678
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 75

Accepted Solution

by:
Aneesh Retnakaran earned 800 total points
ID: 24763684
SELECT *
FROM urTable
WHERE  ISDATE(urDateColumn) = 0
0
 

Author Comment

by:Shepwedd
ID: 24764121
aneeshattingal,

Do you want me to run your query on my table?
0
 

Author Comment

by:Shepwedd
ID: 24764178
No results are returned when I run your query.

I am setting the time value as well as the date value of my column if this causes an issue?
0
 

Author Comment

by:Shepwedd
ID: 24764200
...and the time is being set in 24hr, i.e. a typical value that I'm wanting to delete is 15/07/2009 15:00:00. But obviously it's not being deleted as I get the error.
0
 
LVL 41

Assisted Solution

by:ralmada
ralmada earned 600 total points
ID: 24764258
The problem is not in your table but in the code you're passing from ASP. Have you checked the link I've suggested above?
 
http://forums.asp.net/t/1134244.aspx 
Here's another one:
http://p2p.wrox.com/asp-net-3-5-basics/73673-sqldatetime-overflow.html 
0
 
LVL 57

Assisted Solution

by:Raja Jegan R
Raja Jegan R earned 600 total points
ID: 24764386
What is the datatype of that column either datetime or smalldatetime?

smalldatetime wont support that value. It supports till 06-06-2079 only.

aneesh,
    SELECT *
FROM urTable
WHERE  ISDATE(urDateColumn) = 0

This will work fine for both datetime and smalldatetime.

Shepwedd,
   Can you kindly confirm this one
0
 
LVL 41

Expert Comment

by:ralmada
ID: 24764645
 

I still think the problem is not in the table. If I understood correctly he's trying to delete a record, so the record is already in the table and is valid date. i.e. doing a select with ISDATE will not return any records because the table contains valid dates.

I feel the problem is with the parameter being received from ASP. Probably the asker is sending a '01/01/0001' date which is not supported in SQL. Again, have a look at the links I've suggested.
0

Featured Post

Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…

886 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question