Consider the following query (in MSSQL 2008):
SELECT dateModified FROM SomeTable;
This returns floats in javascript format (milliseconds since 1970):
dateModified
============
1301598290687
1071003581343
1311951478593
How can I convert this to a datetime2 right in the select?
Using the formula from @Mikeal Eriksson’s answer here.
I would convert the float to a bigint and then create the datetime:
See SQL Fiddle with Demo