How to insert 01-JAN-13 12.00.00 AM in SQL Server 2012? -
i using following query
insert employee (first_name, last_name, salary, joining_date, department) values ('john', 'abraham', '1000000', cast('2013-01-13 12:00:00.000' datetime), 'banking')
finally used cast temporary work. need insert format.
just use unseparated format : (this assumes joining_date of type date or datetime)
insert employee (first_name,last_name,salary,joining_date,department) values ('john','abraham','1000000', '20130113 12:00:00','banking')
edit: corrected link
@ : http://www.karaszi.com/sqlserver/info_datetime.asp#dtformatsinput
Comments
Post a Comment