Site Sponsored By: SQLDSC - SQL Server Desired State Configuration
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.
Hi, I have a application in Asp.net.From there I send a Insert statement to SQL 2005 Databases 1) INSERT INTO [EMPLS].[dbo].[Report_DataEntry_User] ( Login_User,Login_User_Name,Computer_Name,Login_DateTime ) VALUES ( 'test', 'khalid malik', 'dl1.avgate.net', '11/23/2008 12:57:44') It give me error The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value2)i cut these statement paste in SQL query of 2005 it work perfect well without any problem?I tried to Regional setting of local machine and server databases it same It did my experement i change the application date Format like MM/dd/yyyy hh:mm:ss i change to dd/MM/yyyy hh:mm:ss it works ? It impossible to change in whole application ? any other methods where i can configure SQL database Server ?Can anybody help me ?thank in advance
visakh16
Very Important crosS Applying yaK Herder
52326 Posts
Posted - 2008-11-24 : 00:39:23
try like below
SET DATEFORMAT mdyINSERT INTO [EMPLS].[dbo].[Report_DataEntry_User] ( Login_User,Login_User_Name,Computer_Name,Login_DateTime ) VALUES ( 'test', 'khalid malik', 'dl1.avgate.net', '11/23/2008 12:57:44')
Khalid_68
Starting Member
2 Posts
Posted - 2008-11-24 : 00:55:42
hi visakh16 u mean to say i have send two statement from my application one set dateformat mdy and second is insert statement
visakh16
Very Important crosS Applying yaK Herder
52326 Posts
Posted - 2008-11-24 : 01:10:17
quote:Originally posted by Khalid_68 hi visakh16 u mean to say i have send two statement from my application one set dateformat mdy and second is insert statement
Yup. as the error may be because its not able to interpret corectly the send dat value from string send by appln.