2 added 176 characters in body
source | link

If not, after reading the data from the csv (from second row), how can I add column names to it?

I would put your focus here. First, create your table with yoru column names, data types, etc.

create table myTable (column1 <datatype>, column2 <datatype>)

Then, bulk insert into it but ignore the first row.

bulk insert myTable
   from 'C:\somefile.csv',
   with( firstrow = 2,
         fieldterminator = ',',
         rowterminator = '\n')

If it's dynamic, then you may want to look into openrowset.

If not, after reading the data from the csv (from second row), how can I add column names to it?

I would put your focus here. First, create your table with yoru column names, data types, etc.

create table myTable (column1 <datatype>, column2 <datatype>)

Then, bulk insert into it but ignore the first row.

bulk insert myTable
   from 'C:\somefile.csv',
   with( firstrow = 2,
         fieldterminator = ',',
         rowterminator = '\n')

If not, after reading the data from the csv (from second row), how can I add column names to it?

I would put your focus here. First, create your table with yoru column names, data types, etc.

create table myTable (column1 <datatype>, column2 <datatype>)

Then, bulk insert into it but ignore the first row.

bulk insert myTable
   from 'C:\somefile.csv',
   with( firstrow = 2,
         fieldterminator = ',',
         rowterminator = '\n')

If it's dynamic, then you may want to look into openrowset.

1
source | link

If not, after reading the data from the csv (from second row), how can I add column names to it?

I would put your focus here. First, create your table with yoru column names, data types, etc.

create table myTable (column1 <datatype>, column2 <datatype>)

Then, bulk insert into it but ignore the first row.

bulk insert myTable
   from 'C:\somefile.csv',
   with( firstrow = 2,
         fieldterminator = ',',
         rowterminator = '\n')