# Database Discussions > MS SQL Server 7/MS SQL Server 2000 >  Bulk Copy Procedure (BCP) with a header row

## Ali Alhussein

Hi, I am have a text file that contain row header. I want to export this text file into pub database to the author table. I usually use this code:
Exec master..xp_cmdshell &#34;bcp pubs..authors in d:dataauthors.txt /c /Snameofserver /Usa /Ppassword&#34;

from sql analyser window. it the text file does not have a header, I am able to export the data, but if the text file Does have a header, I got an error, I know that I can open the text file and delete the header then run the bcp process. But I do  not want to do so, IS there a code that I can add to the bcp code above to accept the header row and have a successful bcp procedure. thanks

----------


## KROM

use the -F switch
this is for the first row to bcp.
so -F2 would start the bcp process 
on the second row.

Krom

------------
Ali Alhussein at 5/4/00 11:20:31 AM


Hi, I am have a text file that contain row header. I want to export this text file into pub database to the author table. I usually use this code:
Exec master..xp_cmdshell &#34;bcp pubs..authors in d:dataauthors.txt /c /Snameofserver /Usa /Ppassword&#34;

from sql analyser window. it the text file does not have a header, I am able to export the data, but if the text file Does have a header, I got an error, I know that I can open the text file and delete the header then run the bcp process. But I do  not want to do so, IS there a code that I can add to the bcp code above to accept the header row and have a successful bcp procedure. thanks

----------


## Ali

Thanks , that was quick and easy  (:

------------
KROM at 5/4/00 11:56:14 AM

use the -F switch
this is for the first row to bcp.
so -F2 would start the bcp process 
on the second row.

Krom

------------
Ali Alhussein at 5/4/00 11:20:31 AM


Hi, I am have a text file that contain row header. I want to export this text file into pub database to the author table. I usually use this code:
Exec master..xp_cmdshell &#34;bcp pubs..authors in d:dataauthors.txt /c /Snameofserver /Usa /Ppassword&#34;

from sql analyser window. it the text file does not have a header, I am able to export the data, but if the text file Does have a header, I got an error, I know that I can open the text file and delete the header then run the bcp process. But I do  not want to do so, IS there a code that I can add to the bcp code above to accept the header row and have a successful bcp procedure. thanks

----------


## Ali Alhussein

Thanks, how can I bcp out a table into a text file including the header row in the text flie

thanks



------------
KROM at 5/4/00 11:56:14 AM

use the -F switch
this is for the first row to bcp.
so -F2 would start the bcp process 
on the second row.

Krom

------------
Ali Alhussein at 5/4/00 11:20:31 AM


Hi, I am have a text file that contain row header. I want to export this text file into pub database to the author table. I usually use this code:
Exec master..xp_cmdshell &#34;bcp pubs..authors in d:dataauthors.txt /c /Snameofserver /Usa /Ppassword&#34;

from sql analyser window. it the text file does not have a header, I am able to export the data, but if the text file Does have a header, I got an error, I know that I can open the text file and delete the header then run the bcp process. But I do  not want to do so, IS there a code that I can add to the bcp code above to accept the header row and have a successful bcp procedure. thanks

----------

