rohan
2006-12-06 07:11:38 UTC
hi,
I need to retrieve data from a table from MS SQL database and then
populate sybase database tables from the same. The procedure i thought
of is: -
1. BCP MS SQL data onto a flat file.
2. Read that flat file and BCP in again into Sybase table.
Now all this processing shall take place through a shell script.
Prior to BCP i created a DSN for connecting to the MS SQL database
When i run the BCP command seperately from a command prompt it runs
fine and generates a flat file form the table too. The i also BCPed in
the flat file into sybase table which too went fine.
But the same procedure wont work from a shell script.
If i try to invoke the bcp command from a unix promt it wont connect to
the MS SQL database which i thought it wont, as per my knowledge
Microsoft hasnt come up with a driver for connecting its SQL server
from unix.
Can anybody suggest as to how shall one BCP MS SQL data within a shell
script or for that matter even a perl script?
Rohan
I need to retrieve data from a table from MS SQL database and then
populate sybase database tables from the same. The procedure i thought
of is: -
1. BCP MS SQL data onto a flat file.
2. Read that flat file and BCP in again into Sybase table.
Now all this processing shall take place through a shell script.
Prior to BCP i created a DSN for connecting to the MS SQL database
When i run the BCP command seperately from a command prompt it runs
fine and generates a flat file form the table too. The i also BCPed in
the flat file into sybase table which too went fine.
But the same procedure wont work from a shell script.
If i try to invoke the bcp command from a unix promt it wont connect to
the MS SQL database which i thought it wont, as per my knowledge
Microsoft hasnt come up with a driver for connecting its SQL server
from unix.
Can anybody suggest as to how shall one BCP MS SQL data within a shell
script or for that matter even a perl script?
Rohan