Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to call DTS package
Message
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Import/Export
Divers
Thread ID:
00790287
Message ID:
00790650
Vues:
15
>Hi all,
>I have created a DTS package to transfer data in Local Packages of SQL Server.
>I wish to call and run it programmatically from my VFP application.
>besides use set time schedule, any other method to call it? such as use EXEC command
>to execute the package name, is it possible?
>thanks for any help.

It can be as simple as this:
loDts = newobject('dts.package')
loDts.LoadFromSqlServer( {you will need to supply param values here} )
loDts.Execute()
Check out the Package object in SQL Books Online for information on the parameters that the LoadFromSqlServer() expects. Basically you need to supply the server name and login info, and the package name.

One thing to watch out for: DTS packages store versions internally, so if you have multiple versions you will need to go thru the SavedPackageInfos collection to get the one you want.

Hope this helps.
Dan LeClair
www.cyberwombat.com
SET RANT ON - The Wombat Blog

Life isn’t a morality contest and purity makes a poor shield. - J. Peter Mulhern
Disclaimer: The comments made here are only my OPINIONS on various aspects of VFP, SQL Server, VS.NET, systems development, or life in general, and my OPINIONS should not be construed to be the authoritative word on any subject. No warranties or degrees of veracity are expressed or implied. Void where prohibited. Side effects may included dizziness, spontaneous combustion, or unexplainable cravings for dark beer. Wash with like colors only, serve immediately for best flavor.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform