Showing posts with label pushes. Show all posts
Showing posts with label pushes. Show all posts

Thursday, March 29, 2012

Executing SQL Package

Hi

I have created a DTS package in SQL 2005 which will pull the data from oracle and pushes into SQLServer. I am able to execute the package from business intelligence wizard.

Is there anyway to trigger this package manually apart from the wizard?.

looking for responses.

Thanks
GaneshIt can also be executed from query analyzer.

You call it from any forntend tool also.|||Hi

Thanks for your response.

When I create package from Business intelligence wizard, It was created as Package1.dtsx. Now , How can I invoke package1.dtsx from query analyzer?.

As far as I know, In oracle, a package will contain main and a body procedures. We can invoke the main procedure from any command prompt. But I am new to SQL packages. Can you suggest me in this regard.

Thanks,
Ganesh

Friday, February 17, 2012

Execute DTS Package using a Stored Procedure from Button Push

I have a site that will run a DTS package from a stored procedure when a user pushes a button. I know the stored procedure works and exectures. I need the .net code on how to execute this particular type of SQL statement.

Any help would be AWESOME.

THX

This is the stored procedure stored in EM:

CREATE PROCEDURE spExportData

AS

Begin Transaction
Set nocount on
EXEC master..xp_cmdshell 'dtsrun /Ssql-06-db\a /NAdultExport -E'
Commit
GO

The code below is what I am currently using and is not working.

Protected Sub btnUpdateList_Clicked(Sender As Object, E As System.EventArgs)
Dim strProc As String = "spExportData"
Dim MyConnClass as New SQLConns
Dim sqlConn as SqlConnection
Dim myCommand As New SqlCommand

sqlConn = MyConnClass.OpenConn("ConnAdultEd")
MyCommand.CommandType = CommandType.StoredProcedure
MyCommand.CommandText = strProc
MyCommand.Connection = sqlConn
MyCommand.ExecuteNonQuery()
MyConnClass.CloseConn(sqlConn)

statuslbl.text = "File updated"

End Sub

stcyrje:

The code below is what I am currently using and is not working

Did you get any error message when calling the stored procedure to run the DTS package? You can also try Package class, take a look at:

http://msdn2.microsoft.com/en-us/library/microsoft.sqlserver.dts.runtime.package(d=ide).aspx