Monday, March 10, 2008

what is bcp

bcp is a unix bulk copy utility used to transfer data from file to table and vice versa.
Ex
1.bcp dbname..tablename out pub_out –c –t ,-r userid –servername
user will be prompted for database password.
In the above example the data from publisher’s table present in pubs2 database is copied to physical file pub_out
2
-c option copies out the data from publisher table in character format
-t option terminator ends each field with comma.
-r row terminator ends each field with return


2.bcp..tablename in pub-out –c –t, -r userid –servername

user will be prompted for database password
above example 2 shows how to copy the data into adaptive server.

No comments: