byrmol Blog

Garbage

A BCP GUI

Due to the excessive amount of BCP work that has plagued me recently, I was sick and tired of typing.
Instead of writing a script in TSQL to build BCP commands, I decided on building a little GUI app.

I have tried to constrain the interface to only allow valid BCP argument combinations, but again due to laziness, I have not tested them all. If the BCP command appears to be doing nothing, you have the option to KILL the process.

Features:

  • Easy to use. (should be!)
  • Tool tips for each switch are taken from BOL
  • Batch option for building (not executing) multiple BCP commands ie. An entire database
  • Automatically redirects output to a temporary file for viewing the results.
  • Integrated File Viewer to look a the first 2MB of a file (needs improvement though)..
  • Monitors file growth of the target data file (OUT modes) or output file (IN mode)
Here's a picture of the main screen..
BCP Helper

I am hoping that this application needs no help file or manual, as it is targeted at developers who at least know what BCP is...

The entry point to this app accepts a parameterless constructor (when you simply open it), or a server name. The second constructor allows us to integrate it into the "Tools" menu in QA.

To integrate this into QA..

  1. Select "Tools".."Customise" from the main menu of QA
  2. Select the "Tools" tab
  3. Press the "Add" button
  4. Enter the Display Name
  5. Fill out the "Command" by browsing to the BCPHelper file
  6. Fill out the "Argument" section with the word $(Server).
If you have completed it correctly it should look something like this...
QA Integration

Now when you select "Tools" from QA, you should see the BCP Helper application.
When you launch the app from QA, it will take the current server and populate the text box.

You will need the .NET framework v1.0 or higher to run this
Oh now there is a bitch..How on earth did MS miss the FolderBrowser Dialog control in 1.0 framework!!!!

Installation is just a matter of extracting the file
This link is the zipped file (22Kb) at SQLTeam. BCPHelper.zip

A special thank you to Damian for uploading the file and for giving some feedback. Also to Rob and Graz for some testing and hosting this...

All comments are welcome, and please report any bugs! Enjoy...

Legacy Comments


Justin
2004-03-31
re: A BCP GUI
Very nice! It's like this tool was custom built for me, I do know what bcp is, but I'm too lazy to commit all the options to memory. :)

DavidM
2004-03-31
re: A BCP GUI
Thank you muchly!

I must admit that by building this thing, I now know all the switches! I'll have to drink alot to erase them...

Jay
2004-03-31
re: A BCP GUI
Nice !!!!!

Greg
2004-04-01
re: A BCP GUI
Very nice...

Todd B
2004-04-01
re: A BCP GUI
Thanks. :)

Jeff
2004-04-01
re: A BCP GUI
David -- this looks excellent !!! very well done !

DavidM
2004-04-01
re: A BCP GUI
Thank you very much Jeff! Any improvements/functionality you would like to see?

Yoshihiro Kawabata
2004-04-02
re: A BCP GUI
Cool !
So, I want to translate to Japanese.
Dose it support Culture resource .resx ?

Jeff
2004-04-03
re: A BCP GUI
David -- the only "feature" missing is the "shareware nag screen" !

It looks very professional and complete ... but admittedly, I am not a BCP regular user so I haven't tried all the features yet.

x002548
2004-04-03
re: A BCP GUI
Just make sure you don't call it with xp_cmdshell 8-)


George
2004-07-16
re: A BCP GUI
I'm just currious ´how the connection strin gshould look? Do I need to specify more than just the IP and port to the db server?

Thanks

-bda-
2004-08-13
re: A BCP GUI
Very nice and useful !!! Thanks.

Adrian Banas'
2004-08-26
re: A BCP GUI
This is just what I have been looking for over the past two days. OUTSTANDING!!!!!!! Now, if you could only add in conversion from Mainframe to ASCII - Adrian

Andres
2005-06-08
re: A BCP GUI
test

saket
2005-06-16
re: A BCP GUI
good work

Kevin Zhang
2005-07-12
re: A BCP GUI
Excellent! It's a nice tool.

Chris Colbert
2005-09-14
re: A BCP GUI
Thx. Nice job and big help to me since I am used to Oracle and sqlloader. I don't know how many instances (I haven't tried to open more than 4) you want to allow the user to open so you might want to add a check on that. Also, once the script is executed from the app you might want to make the tmp file view a response window and place a command button on it. Heck, not that it matters though works fine and I think most of us who would use this tool would probably know better than to open a dozen instances and we know how to close a window. Thanks for taking the time to do it.

Aneesh
2005-10-17
re: A BCP GUI
I got an Application error while running it
'failed to initiate'


Harley Green
2007-03-16
Table Sort Order
Very nice! Thank you.

One enhancement that would be great - have the tables sorted by name.

Stephen
2007-04-10
re: A BCP GUI
Great tool. I used it once and fell in love. Easy to use and a great learning tool.

Paperless
2007-10-04
re: A BCP GUI
I found your utility easy to use and was able to execute a bcp generated with your utility that produced the desired output file.
Unfortunately, when I placed the code in a stored procedure used by Crystal reports, the code fails to output to a mapped drive on the network. However it outputs fine when it points to the local C: drive. Any clue as to what could be going on? (Crystal Reports is using an ODBC driver for SQL.)

Wayne
2008-05-24
re: A BCP GUI
Thanks! This just saved me days of work.

JG
2008-11-22
re: A BCP GUI
DUDE DUDE DUDE I Love you DUDE U Rock. O my god u rock. I need this thing so bad. . . Thanks a million. I'll chill out now but thanks for making this accessible!!

Dave
2009-02-19
re: A BCP GUI
Very helpful for us - thanks.

Michelle C
2009-02-24
re: A BCP GUI
I cant this to run with sql server 2005. I keep getting an error "Unable to open BCP host data-file". Any suggestions?

Thanks,
Michelle

Marc
2009-03-27
re: A BCP GUI
First let me say great tool, now I don’t have to memorize all the BCP switches! Have you ever thought of sharing the source code or going open source? The environment I work in has several different database engines (Oracle, Sybase and MS SQL server) so the batch output your tool creates doesn't work without some tweaks. I think this is a great start and with a few changes could work in my environment well.

pete a
2009-10-06
re: A BCP GUI
Wanted to run via master..xp_cmdShell - that seems to not be working. any ideas