tags:

views:

85

answers:

3

Can the SQL Server Import/Export wizard be called from our windows application?

A: 

I am guessing here but I think that Import\Export wizard from SQL Managament Studio is simply a wrapper for command line tool called bcp.exe.

There is a lot information about bcp on the Internet so I will provide only one link here:

http://msdn.microsoft.com/en-us/library/ms175937.aspx

Wodzu
No, most definitely not. bcp is a command-line "bulkload" utility - but it's **not** the import/export wizard the OP is looking for
marc_s
Thanks @marc_s: for correcting me and showing the location of the wizzard.
Wodzu
+1  A: 

The data import/export wizard is an external app called "DTSWizard.exe", which lives somewhere in your SQL Server installation directories.

In my case, on a 64-bit system with SQL Server 2008 R2 CTP installed, I find it under:

"C:\Program Files (x86)\Microsoft SQL Server\100\DTS\Binn\DTSWizard.exe" 

for the 32-bit version

or

"C:\Program Files\Microsoft SQL Server\100\DTS\Binn\DTSWizard.exe"

for the 64-bit version

You can definitely store those locations in some config file and then execute those from a Winforms app.

Marc

marc_s
+1  A: 

The wizard generates an SSIS package. You could save and use that in your application and use variables etc to control it (example: a filename chosen by the user).

Otherwise, you have absolutely no control over what data goes where in the wizard. Surely the load or export functionality of the application is in the context of what makes sense for you app, not do anything and drop it anywhere?

gbn