Sep-29-2022, 12:07 PM
Hi Team,
I am using below code for transfering data to CSV File,
code is working , But headers are missing .
can you please suggest how to include header in it.
I am using below code for transfering data to CSV File,
code is working , But headers are missing .
can you please suggest how to include header in it.
from pathlib import Path
import subprocess
source_table = "xxx_xxxx_xxx_POC.dbo.Table1"
destination = str(Path("E:\test\table1.csv"))
subprocess.run(["bcp", source_table, "out", destination, "-ABCD12345678\\ABCD5678,10010","-c", '-t"|"', "-T" ])
