I need to generate insert script from SQL Server and when i am using SQL Server Script Generator it CAST datetime values from hex e.g.
CAST(xxxxxxxxxxxxx as dateTime)
How can i avoid this ? I want actual value in script
I need to generate insert script from SQL Server and when i am using SQL Server Script Generator it CAST datetime values from hex e.g.
CAST(xxxxxxxxxxxxx as dateTime)
How can i avoid this ? I want actual value in script
Unfortunatly this is not possible , SQL Server internally produce hex value as DateTime value.
This hex value is logically divided into two group one is Date & other is Time.
e.g. 0x00009CEF00A25634 - hex value.
Date part :- 0x00009CEF (decimal 40175)
Time part :- 00A25634 (decimal 10638900)
If you select this hex value like,
select CAST (0x00009CEF00A25634 as datetime)
it return, 2009-12-30 09:51:03.000
I hope this answer is helpful for you.
Thanks.