Execute DTS Package using Script

No.of Views1217
Bookmarked0 times
Downloads 
Votes0
By  Kirti.M.Darji   On  15 Feb 2010 22:02:16
Tag : Sql Servers , How to
Execute DTS Package using Script
emailbookmarkadd commentsprint

Images in this article missing? We recently lost them in a site migration. We're working to restore these as you read this. Should you need an image in an emergency, please contact us at info@codegain.com

 Introduction

Some day before in my article we learn how to make dts package in here

Technologies
SQl server

Prerequisite

SQl server 2000, Later versions

Implementation

Take one ActiveX Script in DTS Package and put following code in main function like

{codecitation class="brush: vbscript; gutter: true;" width="650px"}

Function Main()

main = DTSTaskExecResult_Success

Dim oPkg, oStep
Dim sServer, sUID, sPWD, iSecurity, sPkgPWD, sPkgName, sErrMsg
Set oPkg = CreateObject("DTS.Package")

' Assign parameters
sServer = "SqlserverName"
sUID = "UserName"
sPWD = "password"
iSecurity = DTSSQLStgFlag_UseTrustedConnection
sPkgPWD = "DtsPackage password"
sPkgName = "DTSPackageName"

' Load Child Package
oPkg.LoadFromSQLServer sServer, sUID, sPWD, iSecurity, sPkgPWD, "", "", sPkgName


' Execute the Package
oPkg.Execute



End Function


{/codecitation}

Conclusion

We can execute dts Package easily using Script. we can also execute more then one DTS package sequentially using script.

Enjoy!!!!!!

Happy Programming.

About the Author


Kirti Darji
P.G.D.C.A, M.SC(Computer Science) 3+ YEAR EXPERIENCE Visual C#.net and VB.net Windows and Web base Application

Expertise :C#.net, VB.Net,ASP.net,SQL Server, MS Access,aJAX, JavaScript,CSS,HTML,XML,N TIRE ARCHITECTURE,oOPS,Web Services,Core Ajax,visual Source safe,IIS

Occupation :SR. Software Developer
Company : MADHUVAN INFO TECH PVT.LTD
Location :AHMADABAD
 
Sign Up to vote for this article
 
About Author
 
Kirti.M.Darji
Occupation-Software Engineer
Company-Maven-Infosoft Pvt.Ltd
Member Type-Expert
Location-Not Provided
Joined date-03 Jun 2009
Home Page-
Blog Page-http://kirtimdarji.blogspot.com/
I am Kirti M. Darji Senior Software Developer Having 3.5 Years Experience In Microsoft .Net(c#) Technologies.
 
 
Other popularSectionarticles
Comments
There is no comments for this articles.
Leave a Reply
Title:
Display Name:
Email:
(not display in page for the security purphase)
Website:
Message:
Please refresh your screen using Ctrl+F5
If you can't read this number refresh your screen
Please input the anti-spam code that you can read in the image.
^ Scroll to Top