Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
sameerv
Starting Member
29 Posts |
Posted - 2002-08-18 : 08:14:21
|
| Hi Guys,I know you guys will get really irritated with me for posting the same problem again.But it is absolutely crucial for me to get this right ... and soon. I'll be greatful for any help that is forthcoming.....And I have no doubt that this forum will crack the problem.THANKS !!!!!!! Here's my problem.I have data to transfer between 2 servers from a delimited text file to a SQL Server 7.0 table.1. A database server (called dbBank) running SQL Server7.0 - lets name it dbs2. An IIS Server which contains the text file to be uploaded. - lets name it IIS.The dbBank database has a table called tblBank :BankCode varchar(15)BankName varchar(100)BankType char(1).A text file named txtBank that has to be uploaded is located on C drive of the IIS Server PC:(Sample)Bk1|Bank Name One|CBk2|Bank Name Two|CBk3|Bank Name Three|II ran the following statement from the command prompt of DBS : bcp dbBank..tblBank in \\IIS\C\txtbank.txt -Sdbs -Usa -P]This command prompts me to create a format file which I then save as fmtBank.fmt on the C drive of the IIS Server PC.I then run the following command from the Command Prompt of DBS. bcp dbBank..tblBank in \\IIS\C\txtbank.txt -f\\IIS\C\fmtBank.fmt -Sdbs -Usa -PThis works perfectly well and my table gets populated with all the records in the text file.Then I opened up the Query Analyzer and ran the same command by attaching it to xp_cmdshell : execute master..xp_cmdshell 'bcp dbBank..tblBank in \\IIS\C\txtbank.txt -f\\IIS\C\fmtBank.fmt -Sdbs -Usa -P'I get the message "The command(s) completed successfully" but no records have been inserted to the table.I have ended up spending an obscene amount of time trying to figure this out but to no avail.I'll greatly appreciate any help I can get on this problem soon.PS:When I run exactly the same command from my SQLServer7.0 Desktop version it populates the table in dbs from the IIS text file and the transfer between IIS and dbs completes perfectly. execute master..xp_cmdshell 'bcp dbBank..tblBank in \\IIS\C\txtbank.txt -f\\IIS\C\fmtBank.fmt -Sdbs -Usa -P'Edited by - sameerv on 08/21/2002 07:13:01Edited by - sameerv on 08/21/2002 07:28:14 |
|
|
|
|
|