question about running bcp with and invalid user

  • I am making a stored procedure, that can be used to call a process that will import data to a staging table, then update a lookup table with this new or updated data. I have username and password that are passed in as paramaters. I put this all together into a xp_cmdshell which calls bcp. but if an invalid user or password is used, then bcp fails, and since i am doing xp_cmdshell, it doesnt report failure to me. But I can tell that no data is in the staging table.

    Can anyone see a better way to make sure that i can connect with bcp in tsql and validate that i have a good user and password?

    feel free to redesign the idea, as I may have taken a differen approach than others.

    esentially, i have a lookup table that will be imported into and updated periodically. I wanted to have a quick way to import said data (bcp) then update or insert said data to a lookup table. By making a proc, its got some dynamicness to it, import file, format file, etc. So it can be reused and takes cleaning and error handling into account. But that forces me to do bcp in the middle, so i figured xp_cmdshell could handle it for me. But in the case of a bad username or password... i dont like the error checking...

    thanks

  • If you are running SQL 2000, try using the T-SQL BULK INSERT statement. It's quicker than BCP ( See 'Optimizing Bulk Copy Performance' in BOL ) and it keeps the processing and error handling in your proc.

    Thanks

    Phill Carter

    Edited by - phillcart on 02/05/2003 8:14:21 PM

    --------------------
    Colt 45 - the original point and click interface

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply