POS Transaction Analyzer User and Installation Guide, SST Version 1.2

Troubleshooting HP NonStop POS Transaction Analyzer 140
7-10-2 Using Windows BCP Command Line Utility
The BCP command line utility is used for exporting the SQL data from an SQL Server to a text file or to other SQL
Servers.
Use the following command to export data from the POS/TA database table to a .txt file.
bcp <query> queryout <txt file name> –c –U <user name> –S <SQL Server>
Where:
<query> is an SQL query.
For example: Select * from <database name>.dbo.<tabName> where <colName>=a
Here:
<database name> is the name of the database
<tabName> is the name of the table to be exported.
<colName> is the name of the column.
queryout is the option to store query result data to outside resources like a .txt file or another database.
<txt file name> is the absolute path of the txt file where the data will be exported.
-c is for carcopy.
-U <user name> is for specifying the SQL server user name.
-S <SQL Server> is for specifying the SQL Server name.
As you enter this command on the command prompt, the utility will ask for the SQL Server password. On
entering the right password the program starts exporting the data immediately.
For details on the BCP utility and other export options which can be used with the utility, refer to Microsoft
documentation.
7-10-3 Importing/Restoring Data to SQL Server
You can use the DTS Import/Export Wizard to import the data from the .txt file or from another SQL database to
the POS/TA SQL database. As in the case of exporting data, the data can be imported immediately or
scheduled for a later time.