Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
gavinjb
Starting Member
34 Posts |
Posted - 2009-07-30 : 05:05:42
|
Hi, When I am trying to run a stored Procedure that takes a DateTime as an input Parameter I am getting the following error and can't work out what I am doing wrong can anyone help.Msg 242, Level 16, State 3, Procedure EMA, Line 15The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value. To run the SP I am using the following SQLEXEC EMA '01-Aug-2009' if I run DBCC UserOptions I find that my date format is set to mdyany ideas.Thanks,Gavin, |
|
|
rajdaksha
Aged Yak Warrior
595 Posts |
Posted - 2009-07-30 : 05:40:13
|
quote: Originally posted by gavinjb Hi, When I am trying to run a stored Procedure that takes a DateTime as an input Parameter I am getting the following error and can't work out what I am doing wrong can anyone help.Msg 242, Level 16, State 3, Procedure EMA, Line 15The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value. To run the SP I am using the following SQLEXEC EMA '01-Aug-2009' if I run DBCC UserOptions I find that my date format is set to mdyany ideas.Thanks,Gavin,
HiThis error message appears, when SQL Server tries to convert a string to a DATETIME value and encounters that the resulting value is outside the valid range for DATETIME values.SQL Server offers a range of DATETIME values between 01/01/1753 and 12/31/9999. Values that are beyond this range cannot be stored in a column of the DATETIME type and any attempt raises this error.-------------------------R.. |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2009-07-30 : 05:52:14
|
| What happens when you run this?EXEC EMA '20090801'MadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|
|
|