.net - Datetime type conversion in SQL -
.net - Datetime type conversion in SQL -
i getting info external datasource , need store in sql server table. 1 filed in datetime. getting datetime field varchar format, , in sql table need save datetime datatype.
convert(datetime,[date_time],03)
-- code work in development environment not in production.
convert(datetime,[date_time],120)
-- code work in production not in development.
this create life hard transfer code development production since have create changes in tested code.
please note using sql server 2008 r2.
is there anyway can create code similar? cannot alter civilization , language on both server since many other applications deployed there , might break existing application in both server.
you can seek utilize set
statement override date format, this:
set dateformat mdy; select convert(datetime, [date_time], 120);
as long include code in stored procedure/query on both environments, should fine. may want read on msdn.
sql .net sql-server sql-server-2008 datetime
Comments
Post a Comment