?
Solved

sql datetime overflow error

Posted on 2008-02-05
8
Medium Priority
?
1,151 Views
Last Modified: 2008-02-05
Been programming a sql datbase routine, using c# and stored procedures.

Was working fine when tested earlier -- but now, when running online I am getting the error message as indicated.

Why would this be so?

Thank you in advance for your time and efforts with this enquiry.
0
Comment
Question by:amillyard
  • 4
  • 2
  • 2
8 Comments
 
LVL 75

Assisted Solution

by:Aneesh Retnakaran
Aneesh Retnakaran earned 400 total points
ID: 20823465
Seems like your db contains records out of range sql can handle
0
 

Author Comment

by:amillyard
ID: 20823511
aneeshattingal:  does this include 'null's ?
0
 

Author Comment

by:amillyard
ID: 20823536
aneeshattingal: does this type of error happening when reading or writing data to db or both?
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 

Author Comment

by:amillyard
ID: 20823664
I am catching this error via the exception error (and using a breakpoint) -- then hover over the ex value -- hence how I got to know this is a sqldate issue.

but...there is no reference (or easily visible) at which point this fails -- there are alot of date time entries within the database table and alot of differnet reading and writing going on.

so to get a feel where the error is actually occuring would be really useful as I only get this 1 error at the exception stage -- how can I search more intelligently for the error etc?
0
 
LVL 75

Assisted Solution

by:Aneesh Retnakaran
Aneesh Retnakaran earned 400 total points
ID: 20823700
aneeshattingal:  does this include 'null's ?

No, this throws error when the date is before 1753

does this type of error happening when reading or writing data to db or both?
While Reading the data , agian it depends


0
 
LVL 22

Accepted Solution

by:
JimBrandley earned 1600 total points
ID: 20825599
In VisualStudio, from the main menu, select Debug/Exceptions. In the ensuing dialog, set it to break when all exceptions are thrown. Now it will break into the debugger as soon as the exception is thrown. All objects and variables are live, so is the call stack. You should be able to tell exactly which SQL statement was executing when the exception was thrown, and you can tell which parameters were bound to the command. That should make it possible to locate the problem.

Jim
0
 

Author Comment

by:amillyard
ID: 20827755
JimBrandley:  spot on !!!   wow -- that is a really useful feature....

I cannot tell you how many hours I have poured over various scripting, adding logical breakpoints etc trying to capture various errors ... disabling certain lines of code, trying to isolate exactly where the issues are.  very painstaking... wow, this hit the mark instantly -- I had 1 number incorrect so a db reference was pointing at the wrong location...a needle in a haystack normally.

thank you so much for this suggestion and advise...true gold nugget on this issue.
0
 
LVL 22

Expert Comment

by:JimBrandley
ID: 20827841
Glad that helped. MS has given us some great tools in this IDE. Unfortunately, sometimes they are not easy to discover. Good luck.

Jim
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

What if you have to shut down the entire Citrix infrastructure for hardware maintenance, software upgrades or "the unknown"? I developed this plan for "the unknown" and hope that it helps you as well. This article explains how to properly shut down …
This month, Experts Exchange sat down with resident SQL expert, Jim Horn, for an in-depth look into the makings of a successful career in SQL.
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.
Suggested Courses

601 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