Dec-08-2022, 05:37 AM
Hi Dead_Eye and Snippsat,
Thanks again for you help, I was looking for BCP or SCP Approach,
because with the below code, I have extracted big sql table data directly into csv .
I wanted combine both, hence answer I was looking in BCP \SCP Style.
pandas cant handle 20gb of sql data or csv data.
copy /b d:\bcp_testing\tablewithheaders.csv+d:\bcp_testing\tablewithoutheaders.csv d:\bcp_testing\TableWithout.csv
Thanks again for you help, I was looking for BCP or SCP Approach,
because with the below code, I have extracted big sql table data directly into csv .
I wanted combine both, hence answer I was looking in BCP \SCP Style.
pandas cant handle 20gb of sql data or csv data.
copy /b d:\bcp_testing\tablewithheaders.csv+d:\bcp_testing\tablewithoutheaders.csv d:\bcp_testing\TableWithout.csv
set bcp_export_server = set bcp_export_DB = set bcp_export_Schema = set bcp_export_Table = BCP"Declare @colnames Varchar(max); select @colnames = COALESCE((@colnames+'|',")+ column_name from %bcp_export_DB%.information_Schema.COLUMNS where Table_schema='%BCP_EXPORT_HSBC_SCHEMA% and Table_name='%bcp_export_Table%' ORDER BY ORDINAL_POSITION;select @colnames;" queryout d:\bcp_testing\tablewithheaders.csv -c-t,-T-S%bcp_export_server% BCP "Select * from %bcp_export_DB%.%bcp_export_Schema%.%bcp_export_Table%" queryout d:\bcp_testing\tablewithoutheaders.csv -c-t"|",-T-S%bcp_export_server% copy /b d:\bcp_testing\tablewithheaders.csv+d:\bcp_testing\tablewithoutheaders.csv d:\bcp_testing\TableWithout.csv