Hi guys,
I create job where I put this query. Its working.
SELECT T0.U_Scid as 'id', T3.U_Boarding as 'start', T3.U_Boarding as 'end', T5.U_Partner as 'room_id', T1.Name as 'status', T0.U_CardName as 'customer', T0.U_ShipName as 'name_ship', T5.U_Type as 'equipment', T3.U_Port as 'port', T3.U_ETA as 'ETA', T3.U_ETD as 'ETD', T0.U_Scid as 'service_id', T2.Name as 'service_classification', T5.U_Type as 'equipment' FROM [XXX].[dbo].[@COR_SC_EQUIP] T5,[XXX].[dbo].[@COR_SC_GENERAL] T3,
[XXX].[dbo].[@COR_SC_HEADER] T0 INNER JOIN [XXX].[dbo].[OSCS] T1 on T0.U_Status = T1.statusID INNER JOIN [XXX].[dbo].[OSCO] T2 on T0.U_Classifi = T2.originID WHERE T3.U_ScID = T0.U_ScID AND T5.U_ScID = T0.U_SciD AND T3.U_Boarding > '2016-01-01 00:00:00.000'
ORDER BY T3.U_ScID
Then I choose advanced in job steps..and choose to save as test.csv. And when I open test.csv, I have data in this format: 217775 2016-07-21 00:00:00.000 2016-07-21 00:00:00.000 66 and not comma delimited. Should I change type from Transact-SQL into something else? So when I want to import it into database it will be in right format.
Thank you so much for your advice
PS: Of course when I run sql I am able to copy table with header and save it into EXCEL and import it easily into another database.