SELECT 'INSERT INTO UCS_UNIT (Unit_ID, Description, QuantityFK, Factor, Multiplier, Last_Update) VALUES(''' + REPLACE(CAST(UnitID AS VARCHAR(36)),'-', '') + ''', ''' + Description + ''', ''' + REPLACE(CAST(QuantityFK AS VARCHAR(36)),'-', '') + ''', ''' + Factor + ''', ''' + Multiplier + ''', TO_DATE(''' + CONVERT(VARCHAR(19), LastUpdate, 121) + ''', ''YYYY-MM-DD HH24:MI:SS''));' AS UCS_Unit FROM uom.Unit WHERE Active = 1;Trying to do some Cast and Convert comparisons gives me varying output but none are what I need.
select UnitID, Factor, CONVERT(VARCHAR(50), Factor, 128) As ConvertFactor, CAST(Factor AS VARCHAR(50)) As CastFactor, CAST(CAST(Factor AS Float) AS VARCHAR(50))AS CompountFactor from uom.Unit where QuantityFK = 'D9930486-53C3-41BD-9444-010E931EF061';
2551443.86974022 2.55144386974022E6 2.55144e+006 2.55144e+006 86400 86400 86400 86400 3153600000.3744 3.1536000003744E9 3.1536e+009 3.1536e+009 157679960.138506 1.57679960138506E8 1.5768e+008 1.5768e+008 2629822.96584 2.62982296584E6 2.62982e+006 2.62982e+006This is a one time data load that I won't be doing again. I wanted something down and dirty.