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 |
|
sqllover
Constraint Violating Yak Guru
338 Posts |
Posted - 2007-02-10 : 00:03:07
|
| hi i am trying to insert time in my column which is in my table.my table has one column named as "intime" which has datatype as datetime. i am doing thuis in vb.net. i used this code in vb.net to get time: dim dat as datetime=datetime.now.tostring("hh:mm:ss tt") and i got time.but i am having this spc for insert:create procedure sptimeinsert(@time datetime) as insert into time values:An unhandled exception of type 'System.Data.SqlTypes.SqlTypeException' occurred in system.data.dllAdditional information: SqlDateTime overflow. Must be between 1/1/1753 12:00:00 AM and 12/31/9999 11:59:59 PMplease any one help to solve this error. |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2007-02-10 : 02:24:19
|
[code]create procedure sptimeinsert(@time datetime)as begin insert into [my table] (intime) select @timeend[/code] KH |
 |
|
|
sqllover
Constraint Violating Yak Guru
338 Posts |
Posted - 2007-02-10 : 03:07:21
|
| hi khtan , again the same error iam getting An unhandled exception of type 'System.Data.SqlTypes.SqlTypeException' occurred in system.data.dllAdditional information: SqlDateTime overflow. Must be between 1/1/1753 12:00:00 AM and 12/31/9999 11:59:59 PM.please help me to solve this error |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2007-02-10 : 04:50:41
|
what is the value of @time that you pass in ? KH |
 |
|
|
sqllover
Constraint Violating Yak Guru
338 Posts |
Posted - 2007-02-10 : 05:08:33
|
| hi khtan, i am passing 1:30:00 pm n ow please help me |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2007-02-10 : 06:15:58
|
are you passing in as string ? try convert to datetime before passing in KH |
 |
|
|
|
|
|