INSERT INTO [Member](FirstName, LastName, CreationDate, LastActivityDate) VALUES ('Saif', 'Ikram' , '13/04/2013 22:15:44', '01/01/1753 00:00:00') go
"The conversion of a varchar data type to a datetime data type resulted in an out-of-range value". Actually there is nothing wrong with sql. Now run following sql to see if this works
set language british go INSERT INTO [Member](FirstName, LastName, CreationDate, LastActivityDate) VALUES ('Saif', 'Ikram' , '13/04/2013 22:15:44', '01/01/1753 00:00:00') go
Now surprisingly this works, only addition is assigning language to "British". As I am using NHibernate this still is not acceptable. So I have updated my default language
USE CSharpTechies; GO EXEC sp_configure 'default language', 1033 ; GO RECONFIGURE ; GO1033 for "British English" as described in msdn sys.syslanguages. But this also failed. The reason was the user that sql is run as. So update the language setting for user
EXEC sp_defaultlanguage 'saif', 'british'sql now executes without any error
Education makes machines which act like men and produces men who act like machines. ~Erich Fromm
0 comments:
Post a Comment