BCP Utility – using BCP IN in Microsoft SQL Server
In this posting I will show you (BCP IN) how easily you can transfer your data from your operating system file to Microsoft SQL Server database. If you have not read my posting on BCP OUT then click here BCP Utility – using BCP OUT in Microsoft SQL Server to read it.
The Syntax diagram for the BCP command is shown below:
BCP Utility – using BCP OUT in Microsoft SQL Server
BCP is a tool developed by Microsoft which can be easily used to migrate data from one database to another or to copy data from the SQL Server database to a operating system file or vice versa. This is a very powerful tool that I found very useful while working on my development work using SQL Server databases. To export data using BCP you your BCP OUT and to import data you will use BCP IN. In this posting I will show you (BCP OUT) how easily you can transfer your data from your Microsoft SQL Server database to an operating system file.
To find out whether you have bcp utility properly installed/configured in your machine (of course with SQL Server database) just open a DOS prompt and type bcp abd hit ENTER key as shown below:
C:\>bcp
usage: bcp {dbtable | query} {in | out | queryout | format} datafile
[-m maxerrors] [-f formatfile] [-e errfile]
[-F firstrow] [-L lastrow] [-b batchsize]
[-n native type] [-c character type] [-w wide character type]
[-N keep non-text native] [-V file format version] [-q quoted identifier]
[-C code page specifier] [-t field terminator] [-r row terminator]
[-i inputfile] [-o outfile] [-a packetsize]
[-S server name] [-U username] [-P password]
[-T trusted connection] [-v version] [-R regional enable]
[-k keep null values] [-E keep identity values]
[-h "load hints"]
Recent Comments