kumar
kumar

Reputation: 21

Initiate SQL Server Import/Export wizard?

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

Upvotes: 2

Views: 1776

Answers (3)

gbn
gbn

Reputation: 432180

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?

Upvotes: 1

marc_s
marc_s

Reputation: 754240

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

Upvotes: 3

Wodzu
Wodzu

Reputation: 6979

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

Upvotes: 0

Related Questions