Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    MS SQL Server






SuperbHosting.net have generously sponsored dedicated servers to ensure a reliable and scalable dedicated hosting solution for BigResource.com.





How To Make A Stored Procedure Into SSIS Package


 

hi,
I need to convert a stored procedure in to a SSIS package, do any body have an idea on this. thanks in advance




View Complete Forum Thread with Replies
Sponsored Links:

Related Messages:
How To Execute Ssis Package From Stored Procedure
how to excute ssis package from stored procedure and get the parameters back from ssis into the stored procedure.

View Replies !   View Related
Stored Procedure To Executing An SSIS Package
In SQL Server 2005  I need a stored procedure that will execute an SSIS Package for me. There is some earlier stuff on the board but I don't understand it. I don't want to create a Job to do it if I don't have to.

Thanks,

George Cooper

 

 

View Replies !   View Related
Executing SSIS Package From Stored Procedure
Hey guys,
I've got a problem here. I need to send the query result to a csv file then transfer the file to a website. I thought this is a good candidate for a SSIS package. The package is ready now but I don't know how can I execute it from within a stored procedure.
I thought sp_OA family of extended procedure would be helpfull. After  following steps: 
EXEC @hr1 = sp_OACreate 'DTS.Package', @oPKG OUT

EXEC @hr1 = sp_OAMethod @oPKG, 'LoadFromSQLServer("foo", ,, 256, , , , "foo1")', NULL

EXEC @hr1 = sp_OAMethod @oPKG, 'exec'
EXEC @hr1 = sp_OADestroy @oPKG
it tells me command execute successfully. But no package actually gets executed and I can see no results
Thanks

View Replies !   View Related
Calling SSIS Package From Stored Procedure
I'm trying to create a stored procedure which will run 2 SSIS packages before it runs some other SQL code. I read [url=http://msdn2.microsoft.com/en-us/library/ms162810.aspx]this[/url] article. I'm trying to use the package from the file system.

Here is the my code:

CREATE PROCEDURE usp_participant_limits_report
AS
dtexec /f "C:....Activity_Limits.dtsx"
GO

The error message says it doesn't like the "/". Anyone?

View Replies !   View Related
Execution Of SSIS Package From Stored Procedure
Hello friends!
I have one query regarding execution of SSIS package through Stored Procedure.

I have created SSIS package which extract data from database and put that into various text files.Here I am using two global variables one is for Department ID and another is path where I wanna to place my text files as per departments.When I ran it through command prompt it works fine but now I want that dtsx package to run from stored procedure with same input parameters

when i searched on line i got this solution

Declare @FilePath varchar(2000)

Declare @Filename varchar(1000)

Declare @cmd varchar(2000)

set @FilePath = 'C:setupSSIS PackagesSSIS Package File Extract DataSSIS Package File Extract Datain'

set @Filename = 'DataExtract.dtsx'

select @cmd = 'DTExec /F "' + @FilePath + @Filename + '"'

print @cmd

exec master..xp_cmdshell @cmd



but when i execute it i got error like

Source: {8A27E8DF-051B-4F6B-9538-85BED1F161D8}
Description: Unable to load the package as XML because of package does not have a valid XML format. A specific XML parser error will be posted.
End Error
Error: 2007-02-22 11:31:37.32
Code: 0xC0011002
Source: {8A27E8DF-051B-4F6B-9538-85BED1F161D8}
Description: Failed to open package file "C:setupSSIS PackagesSSIS Package File Extract DataSSIS Package File Extract DatainDataExtract.dtsx" due to error 0x80070003 "The system cannot find the path specified.". This happens when loadin
g a package and the file cannot be opened or loaded correctly into the XML document. This can be the result of either providing an incorrect file name was specified when calling LoadPackage or the XML file was specified and has an incorrect format.
End Error
Could not load package "C:setupSSIS PackagesSSIS Package File Extract DataSSIS Package File Extract DatainDataExtract.dtsx" because of error 0xC0011002.
Description: Failed to open package file "C:setupSSIS PackagesSSIS Package File Extract DataSSIS Package File Extract DatainDataExtract.dtsx" due to error 0x80070003 "The system cannot find the path specified.". This happens when loading a
package and the file cannot be opened or loaded correctly into the XML document. This can be the result of either providing an incorrect file name was specified when calling LoadPackage or the XML file was specified and has an incorrect format.

And also I am not understand where i should pass my two input parameters which I used in SSIS package variables???????

Please help me out

Thanks

View Replies !   View Related
Debugging A CLR Stored Procedure That Is Being Called From An SSIS Package
I need help debugging a CLR stored procedure that is being called from an SSIS package. I can debug the procedure itself from within Visual Studio by using "Step into stored procedure" from Server Explorer, but really need to debug it as it is being called from SSIS.

View Replies !   View Related
Calling A AS400 (IBM DB2) Stored Procedure From Within SSIS Package
Hi:

I would like to find out how would I call an AS400 (IBM DB2) iSeries Stored Procedure from within my SSIS Package. What tasks should i be using? and do I need any additional adapters installed on my machine to access AS400(IBM DB2). Thanks.

 

MA

View Replies !   View Related
Problem Executing Ssis Package Through Stored Procedure
Hi,
I have an ssis package which reads a file and upload the data into a table.
Im executing this package through Stored procedure through dtexec /F command
If im uploading this file from local machine the package is executing and the data is uploaded to the table.
If it is in network and try to upload it will through an error that can't upload the file..
I have also shared the file on the network.

Can anyone help

View Replies !   View Related
Debugging A CLR Stored Procedure That Is Being Called From An SSIS Package
 
I need help debugging a CLR stored procedure that is being called from an SSIS package. I can debug the procedure itself from within Visual Studio by using "Step into stored procedure" from Server Explorer, but really need to debug it as it is being called from SSIS.

 

View Replies !   View Related
SSIS Package Executes Within BIDS But Not From A Stored Procedure
I have a SSIS package that contains a DTS 2000 package in it.  The DTS 2000
package imports data into several tables from an ODBC data source.  When I
execute the package through BIDS, no problems.  Everything works great.  I am
now trying to execute the SSIS package in my stored procedure & it gives me
the following error:
Error: 2007-01-30 11:54:24.06
  Code: 0x00000000
  Source: Populate IncrTables
  Description: System.Runtime.InteropServices.COMException (0x80040427):
Execution was canceled by user.
  at DTS.PackageClass.Execute()
  at
Microsoft.SqlServer.Dts.Tasks.Exec80PackageTask.Exec80PackageTask.ExecuteThread()
End Error

I did a search for this & found KB 904796.  It had the exact error message
but I don't believe my packages uses 2000 metadata services.  Just to be
safe, I reinstalled the backward compatibility features & the DTS 2000 tools
on the server.  That still did not fix anything.  I found another forum that
suggested loading the DTS 2000 package internally, which I did & it did not
fix anything.  I am using a password for the protection level so that is not
causing my issue. Does anyone else have any suggestions as to what I might be
able to try?

SQL 2005 Dev Ed SP1 & post SP1 hotfixes installed
Win 2k3 server
Thanks!
John

View Replies !   View Related
Call SSIS Package From Stored Procedure And Pass Parameter
 I am new to the SSIS.

For DTS package of sql server 2000, I can call a DTS package from stored procedure. The command is:

dtsrun /E /SMyServer /NMyDTS /Wtrue /A Parameter1:3= 'Test'

Does anyone know, how do I do the similar thing from SSIS environment.

1) How to call a SSIS package from Stored Procedure?
2) How do I pass parameter to the SSIS package?

Thanks everyone.

View Replies !   View Related
Passing SSIS Package Variable To Stored Procedure As Parameter
 

I've created a varible timeStamp that I want to feed into a stored procedure but I'm not having any luck. I'm sure its a simple SSIS 101 problem that I can't see or I may be using the wrong syntax
 
in Execute SQL Task Editor I have
conn type -- ole db
connection -- some server
sql source type -- direct input
sql statement -- exec testStoredProc @timeStamp = ?
 
if I put a value direclty into the statement it works just fine: exec testStoredProc '02-25-2008'
 
This is the syntax I found to execute the procedure, I don't udnerstand  few things about it.
 
1. why when I try to run it it changes it to exec testStoredProc @timeStamp = ? with error: EXEC construct or statement is not supported , followed by erro: no value given for one or more requreid parameters.
 
2. I tired using SQL commands exec testStoredProc @timeStamp and exec testStoredProc timeStamp  but nothing happens. Just an error saying unable to convert varchar to datetime
 
3. Also from SRS I usually have to point the timeStamp to @timeStamp and I dont know how to do that here I thought it was part of the parameter mapping but I can't figure out what the parameter name and parameter size should be; size defaults to -1.
 
Thank you, please help.

View Replies !   View Related
How To Pass A Null Parameter To A Stored Procedure Executed Within A SSIS Package?
I have a SSIS package that I am trying to execute a stored procedure (the stored procedure references a linked server) within a execute sql object.  The stored procedure has two parameters. I am passing the one parameter to the SSIS package upon execution.  The second parameter is an output paramter.  When I execute the SP normally through SSMS, I just pass a null value for the second parameter.  I can't figure out how to get this to work with the execute sql task.  I created a parameter in the parameter mapping tab.  Not knowing exactly how to do it, I created a new string variable type & left the value empty.  I then set it to be an output direction.  I set the datatype to be varchar & just called it param2.

When I execute the sp, I use the following syntax:  exec sproc ?,?.  I get the following errors:

OLE DB Provider "SQLNCLI" for linked server returned message "No transcation is active.".

Executing the query exec sproc ?,? failed "the operation could not be performed because OLE DB provider "SQLNCLI" for linked server was unable to begin a distributed transation.  Possible failure reasons:  problems with the query, resultset property not set correctly, parameters not set correctly.

I have the linked server setup correctly & I am able to execute the SP through SSMS.

Any help would be appreciated!  Let me know if you need more clarification.  I can also forward my SSIS package for you to look at if you would be willing.

 

Thanks!
John

View Replies !   View Related
How To Make Changes In The SSIS Package W/o Opening It.
Hello,
 
We need duplicate a large number of SSIS packages , changing only server connection and database name inside the OLE DB Source sql command. Is there any easy way to do it , I mean without opening every package individually?
 
Thanks,
 
BeginnerInBiztalk

View Replies !   View Related
Make A Stored Procedure
Hi

In my table i have a datetime field
now i want to delete all records there are more than 1 hour old
can someone help me with this

Alvin

 

View Replies !   View Related
Make A Call To AS/400 Stored Procedure From DTS
Can DTS make a call to a stored procedure on an AS/400 and accept data from that call. I need to access the AS/400 through OLE/DB for AS/400, execute the call to a stored procedure (the AS/400 stored procedure gets the data from DB2/400, executes some business logic, then presents the record set), and grab the record set returned and dump it into a SQL 7.0 table.

View Replies !   View Related
Make The Stored Procedure To Run Daily
 

Hi,
 
I have created a stored procedure that will read the content of the text files of a particular folder. I need to make the stored procedure to run daily so that it will read the new files that is present in that folder. I have written a stored procedure to make the process of reading the file. But i need to know how to make the stored procedure to run daily so that it will automatically read all the files. I have got the information that it can be made possible using dts package. As i dont have any knowledge about dts package can anyone help me how to make this possible.
 
Thanks in advance for any help.
 
Regards,
Sangeetha

View Replies !   View Related
Is It Possible To Make An Installer Package(msi And Exe Files) For Stored Procedures,tables,views
Hi,
 
I've a doubt regarding deploying and creating package (MSI and EXE files) for SQL Stored procedures,views,tables,functions,triggers etc.,just like ASP.NET application by publishing and deploying..Is it possible in the same way for sql objects.If so,pls help me how to do it?
 
Thanks in advance.

View Replies !   View Related
Stored Procedure To Make Backup Of Database...
Can anyone point me to the right direction with the stored procedure on making a backup of the database. I am not looking for a scheduled backup. I'm looking for when the stored procedure get executed, the backup start right away. I believe it also require a username and password as well.

Thanks...

View Replies !   View Related
Make A Dynamic Cursor In A Stored Procedure
I need im my aplication to meke a "Cursor" in a execution of a stored procedure.

For sample:

In a table with a report definition I have the "Fileds, From, Group, Order " clausulas and  I need make a cursor with  a contents of this fileds.

How can I do ???

My code:

Declare @idRelat int, @cmd_FROM nvarchar(1024), @cmd_Det nvarchar(50)
SELECT @idRelat = idRelat, @cmd_Det = cmd_DET
FROM RelatĂłrios WHERE Nome = @p_Relat

Declare @Tot_Col smallint, @Tot_Lin smallint, @Campos smallint,
  @Aux_Select nvarchar(1024), @Aux_Group nvarchar(1024), @Aux_Order nvarchar(1024)

Select @Tot_Col = 0
Select @Tot_Lin = 0
Select @Campos = 0
Select @Aux_Select = "SELECT " + @cmd_DET + "AS Soma"
Select @Aux_Group = "GROUP BY "
Select @Aux_Order = "ORDER BY "
Declare @a_Local char(1), @a_Linha smallint, @a_Campo nvarchar(50)
Declare cur_Aux insensitive cursor for
  SELECT Local, Linha, Campo
  From RelatĂłrios_Margens
  WHERE (idRelat = @idRelat)
  ORDER BY Local, Linha
Open cur_Aux
Fetch cur_Aux into @a_Local, @a_Linha, @a_Campo
While @@FETCH_status = 0 begin
  If @a_Local = "C"
    Select @Tot_Col = @Tot_Col + 1
  Else
    Select @Tot_Lin = @Tot_Lin + 1
  Select @Campos = @Campos + 1
  If @Aux_Group <> "GROUP BY " begin 
    Select @Aux_Group = @Aux_Group + ", "
  If @Aux_Order <> "ORDER BY " begin 
    Select @Aux_Order = @Aux_Order + ", "
  Select @Aux_Select = sSelect + ", " + @a_Campo + " AS Campo" + @Campos
  Select @Aux_Group = @Aux_Group + @a_Campo
  Select @Aux_Order = @Aux_Order + @a_Campo
  Fetch cur_Aux into @a_Local, @a_Linha, @a_Campo
End
Select @Aux_Select = @Aux_Select
-- <<<< MONTA COMANDO SQL
Select @Aux_Select = @Aux_Select + " " + @cmd_FROM + " " + @p_Filtro + " " + @Aux_Group + " " + @Aux_Order
Declare @Cursor_Aux cursor
Set @Cursor_Aux = cursor for @Aux_Select
Open @Cursor_Aux

Not working !!!!

 

View Replies !   View Related
I Need To Make This Stored Procedure 2005 Compatible
Hello.

I need to quickly make this proc compatible with SQL 2005 and am struggling. I have alot of catching up to do.

Basically, it checks for Foreign Key dependencies in a database. There might be a better way to do this in SQL 2005 but for know I really need to get this working.  Any help is verry much appreciated!

--------------------------------------------------------

SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO

ALTER  Procedure aes.Check_Dependent_Rows_Exist
(@RowID int,
@has_rows int OUTPUT
)
AS
BEGIN
 DECLARE @Colname varchar(200), @Tablename varchar(200)
 DECLARE @cnt int
 DECLARE @temp_row int
 DECLARE @owner varchar(25)
 DECLARE @ownerid int
 DECLARE @lstrSql nvarchar(2000)
 -- #1: declare cursor for maximum performance
 DECLARE lcur CURSOR LOCAL FORWARD_ONLY KEYSET READ_ONLY FOR
 
      SELECT syscolumns.Name, OBJECT_NAME(fkeyid) AS FkeyTableName
      FROM sysreferences
  INNER JOIN syscolumns ON sysreferences.fkeyid=syscolumns.id AND fkey1=syscolumns.colid
      WHERE OBJECT_NAME(rkeyid)= 'customer'

 OPEN lcur
  CREATE TABLE #Temp (DependentRows int)
  --  #2: only return a bit indicating if dependant rows exist or not

  SET @has_rows = 0
  

 FETCH NEXT FROM lcur INTO @Colname,@Tablename
 
  WHILE @@FETCH_STATUS = 0
      BEGIN
   SET @temp_row = 0  
   
   SELECT @ownerid = uid from sysobjects where name = @Tablename
   SELECT @owner = [name] from sysusers where uid = @ownerid   

   SET @lstrSql= 'insert into #Temp Select DependentRows = Count(' + @Colname + ') from ' + @owner + '.' + @TableName + ' where ' +
   @Colname + ' =' + CAST(@RowID AS VARCHAR(16)) + ''
   --print @lstrSql
   EXEC (@lstrSql)
   SELECT @temp_row = ISNULL(DependentRows,0) FROM #Temp
   IF @temp_row > 0
   BEGIN
   -- #3: stop processing as soon as dependant rows are found to exist
   SET @has_rows = 1
   BREAK
   END
   
  FETCH NEXT FROM lcur INTO @Colname,@TableName

     END
  deallocate  lcur
END
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO

-----------------------------------------------------------------------

error
Server: Msg 208, Level 16, State 1, Line 1
Invalid object name 'dbo.order_detail'.
Server: Msg 208, Level 16, State 1, Line 1
Invalid object name 'dbo.invoice_header'.
Server: Msg 208, Level 16, State 1, Line 1
Invalid object name 'dbo.order_header'.
Server: Msg 208, Level 16, State 1, Line 1
Invalid object name 'dbo.payment'.
Server: Msg 208, Level 16, State 1, Line 1
Invalid object name 'dbo.cash_on_account'.
 
(1 row(s) affected)
 
Cannot grant, deny, or revoke permissions to sa, dbo, information_schema, sys, or yourself.

View Replies !   View Related
Mssql 2005. How To Make Update Stored Procedure ?
Hi ~
I made simple stored procedure that is to update user information following as...
ALTER PROCEDURE UpdateUserProfile(  @user_id uniqueidentifier,  @user_firstname nvarchar(50),  @user_lastname nvarchar(50),  @user_birth nvarchar(20),   @user_gender nvarchar(20)  )
AS 
 UPDATE user_profile    SET         user_firstname = @user_firstname,     user_lastname = @user_lastname,     user_birth = @user_birth,     user_gender =  @user_gender  WHERE user_id = @user_id  RETURN
When I tried to save this procedure, I faced on "Invalid Object : UpdateUserProfile" error message.
What's the problem ? 
 

View Replies !   View Related
Stored Procedure Make String From Table Field
Hallo !I have a Table with a column "ordernumber"ordernumberA12A45A77A88Is it possible to create a stored procedure which makes a string of these column ?Result: string = ('A12','A45','A77','A88')Thanks !aaapaul

View Replies !   View Related
How To Make A Program Quit In The Middle Of The Trigger (stored Procedure)?
Hi, i made a trigger and takes 2 columns combine the value and place on
the third columns on insert.  Everything has been doing fine until
recently, the policy has changed:  those 2 columns are now allowed
NULL.

This trigger will bomb if either or both of those 2 columns are null, so I need some ways to bail in the middle of the trigger.
Please show me what the correct sytax I need in order to escacpe from a stored procedure?  thank  you.

p.s: i'm thinking it will be alone the line as this:

if @firstCol = null
    return
end
if @secondCol = null
    return
end

View Replies !   View Related
Make SQL Server Distinguish Between Uppercase And Lowercase Characters In A Stored Procedure?
I would like SQL Server 2000 to distinguish between uppercase and lowercase letters, but only within a single stored procedure. Also, at the end of the sp, I want the original collation to be restored. How will I implement this in my sp?

View Replies !   View Related
How To Make Access97 Create Asp File From A Passthrough Query Using An Sql Stored Procedure
i encounter a message from access97 stating that i cannot make asp`s from
passthrough queries usng the database publishing of access97 when i try to make access97 create an asp file from a passthrough query using an sql stored procedure. i could work around this directly in html with asp controls but i would like to get the asp published directly through access97. any suggestions?

View Replies !   View Related
SSIS Invoke Procedure In Oracle Package
Hello there,

I'am asking you people if it's possible to invoke procedure, functions in package in Oracle database > 9.X with SSIS package...

Thx for your incoming answers

Regards,

KiK2k1

View Replies !   View Related
Where Is SSIS Package Stored?
I have used Import-Export wizard to import some data from a flat file into a db table. When prompted, I have chosen to store the package in SQL Server. The package is executing correctly, scheduled to run (job) once a day...the problem is that I can not see this package in EM and I do not know how to open it in BIDS (since i can not point to a certain file). I can see the package in msdb sysdtspackages90 table, but nowhere else in EM - under management->Maintenance Plans I can see the packages created for db maintenance, but not the one created using import-export wizard. I can se the GUID in the job (command line tab) but the search for the GUID # does not yield any results. The searc for .dtsx does not show this package either. Where is it? If I wanted to open and edit this package with BIDS, how would I do that?

Thanks in advance!

View Replies !   View Related
Where Is My SSIS Package Stored
Hi, I am new to SQL 2005 and to SSIS Packages so please forgive the silly question.
I just right-clicked on my database and chose ALLTASKSImport Data.
I selected my flat file and went through the rest of the wizard.
I saved the package when prompted so I can run it later with SQL server Agent.
But now I can't find where the Package is so that I can run it.
In SQL2k I could just look under the DTS folder and find my package.

thanks
ICW

View Replies !   View Related
SSIS PACKAGE STORED
Hi Friends,

In MS SQL SERVER 2005 we created one new SSIS package.

Where it will be stored in MS SQL SERVER 2005.

Default location SSIS package storage in MS SQL SERVER 2005

Ths & Regaurds
shiv

Meti BEST OF THE BEST

View Replies !   View Related
Where Ssis Package Owner Is Stored?
Dear fellows,

I'm looking for at sysdtspackages90 or another tables I am not be able to see it.

Let me know

TIA

View Replies !   View Related
DTS PACKAGE From A Stored Procedure
Is it possible to execute a DTS package from a stored Procedure.

If so do let me know.

Thanks

-Rajesh

View Replies !   View Related
How To I Run A DTS Package From A Stored Procedure? Thank
I created a DTS package to transfer data from a remote database into my local database, I want to run this DTS in my stored procedure, can I do that?

Please help me, thanks a lot

View Replies !   View Related
Dts Package - Stored Procedure
I created a dts package and I can execute it.
I want to include the dts package execution in a stored procedure, but I can't get the stored procedure to execute it from the cmdshell.
I have sql integration services and mssql 2005 services  running under a domain account.
I have saved the package as a FILE System stored package.
I just can't find a reason why it won't execute from stored procedure.....
 
Ron
 

View Replies !   View Related
Unable To Run SSIS Package Using Stored Proc
Hi all,

I have created an SSIS package with protection level - EncryptSensitiveWithUserKey. It is running alright from Visual Studio Environment but i need to call the package from an application, so i created a stored proc to call it, but getting the following error while running the stored proc:

 

Error: 2007-04-16 17:55:05.78

Code: 0xC0016016

Source:

Description: Failed to decrypt protected XML node "DTSassword" with error 0x8009000B "Key not valid for use in specified state.". You may not be authorized to access this information. This error occurs when there is a cryptographic error. Verify that

the correct key is available.

End Error

 

 

any solution?

View Replies !   View Related
Looping A Stored Procedure In A Dts Package
Hello,I have a stored procedure that processes an individual file from adirectory and archives it in a subdirectory.Now, the problem is, when iexecute it , it will only process one file. What i want to do is to checkto see if there are any files in the folder, and if there are , processthem all, and once done, go to the next part in a DTS package, if there areno files, simply go to the next part in the DTS package. I tried an activexscript that would get the filecount in the folder, and if there were morethan 0 files in the folder, then DTS-sUCCESS and on "success" workflow , itwould run the stored procedure, and thus it woould process one file, then"on completion" the workflow connected it back to the activeX script(thuslooping), which would count the files again. Now if there were 0 files, itwould report DTS_FAILIURE, and I had it set up ,"on failiure" to go to thenext step in the package, but it wouldn't run.Someone mind showing me a ray of light?

View Replies !   View Related
SQL 2000 - Stored Procedure Or DTS Package?
I need to automate the following function. I know I can do this in .NET but I need to have a DTS package setup so it executes every evening.

I have a view that produces a list of sales errors. I want to grab the SaleID from each record and insert a record into a "Current Queue" table.

Here is another example of what I'm trying to do...

SELECT SaleID FROM vw_SalesErrors

- with the results of the SQL statement above

INSERT INTO tbl_QueueRecords
(SaleID, QueueID)
VALUES
(@SaleID, 14)

I'm assuming there is a way to automate this into a single stored procedure or at least a DTS pacakge.

Thanks for all of your help.

View Replies !   View Related
How To Execute DTS Package From Stored Procedure
Hi everybody,
I would like to ask that how can I execute a package from a stored procedure.
Laci

View Replies !   View Related
Execute DTS Package From A Stored Procedure?
When I run the code microsoft give to launch a DTS package from a stored procedure, the procedure runs continuously, never ending.

When I run the DTS package manually, or from a dtsrun utility, it only takes seconds.

I'm trying to automate this package so it will run after a field in a table has been updated.

Any suggestions are more than welcome.

PS. Here's the code I've been using (that doesn't seem to work):

--- Declare Variables
Declare @hr int
Declare @oPkg int

--- Create Package Object
Exec @hr = sp_OACreate 'DTS.Package', @oPkg OUT
If @hr <> 0
Begin
Print '*** Create Package Object Failed'
Exec sp_oageterrorinfo @oPkg, @hr
Return
End

--- Load Package
---DTSSQLStorageFlags :
---DTSSQLFlag_Default = 0
---DTSSQLStgFlag_UseTrustedConnection = 256

Exec @hr = sp_OAMEthod @oPkg,'LoadFromSqlServer("JENNSERVER", "", "", 256, , , , "RunMS")',null
If @hr <> 0
Begin
Print '*** Load Package Failed'
Exec sp_oageterrorinfo @oPkg, @hr
Return
End

--- Execute Package
Exec @hr = sp_OAMethod @oPkg, 'Execute'
If @hr <> 0
Begin
Print '*** Execute Failed'
Exec sp_oageterrorinfo @oPkg, @hr
Return
End

--- Clean Up Package
Exec @hr = sp_oadestroy @oPkg
If @hr <> 0
Begin
Print '*** Destroy Package Failed'
Exec sp_oageterrorinfo @oPkg, @hr
Return
End

View Replies !   View Related
Calling A DTS Package From A Stored Procedure
I have a DTS package written to import data from a txt file into a SQL Server 7.0 table
but before importing the data i need to delete the existing data from the table...
for this i need to use the stored procedure to delete data first...
how do i run the dts package from the stored procedure..does anyone know the command for this...

regards,
reshma

View Replies !   View Related
How To Invoke DTS Package From A Stored Procedure
I have a DTS Package to populate data from excel sheet to direct simple table. I like to call this DTS from User interface. thanks in advance

View Replies !   View Related
Is It Possible To Call A DTS Package In A Stored Procedure
Hi,

     I wanted to know if i can a DTS package using a stored procedure and if yes how should i do it.

 

Regards,

Karen

View Replies !   View Related
How To Execute SSIS Package With Configuration Stored In SQL Server?
Hi,

I have a SSIS package called "MyExport" stored on the SQL server 2005 standard SP1. I have created an SSIS package configuration stored in a SQL table msdb.dbo.SSIS Configurations, with the configurationFilter = "Export2" with some configuration values which I can change programmatically as needed.

How do I execute this package with the configuration in the SQL table? I don't seem to have any problem when the package configuration is stored in an .xml file. The documentation is very poor or non-existant on trying to do execute the package with configurations stored in SQL server. I just can't seem to get the proper syntax.

Can someone give me an example of a dtexec command for the above or maybe some c# code?

In Execute Package Utility, when you select the Configurations option, it pops up a dialog box for a FILE based configuration file (*.dtsconfig). There is NO WAY to access a configuration stored in the [dbo].[SSIS
Configurations] table - which is where the SQL based configurations are stored. If you could pick a SQL based configuration, you would then need to pick the ConfigurationFilter for the configuration you want to use.

It's the same when you try to create a new job in SQL Server Agent - you can't select the package configuration stored in SQL server. When you get to the configurations tab, you can only add a file based configuration.

I've checked BOL as well, and there are no examples or discussion of this that I can find.

If anyone can point me in the proper direction, I'd appreciate it.

Thanks.

View Replies !   View Related
SSIS Package Configurations Stored In SQL Server Table
I have two SSIS projects each with different packages. I have setup the packages with configurations stored in a SQL Server table in MSDB. When I create the configuration on the second project it overwrites all of the first projects configurations. Is there a way to to get two different project configurations stored in the same SQL Server table? Any help would be greatly appreciated. Thanks!

View Replies !   View Related
SSIS Updating Package Variables From Stored Procedures
 
I have been looking at the project Real reference implementation for doing auditing of data uploads. The tables and store procedures are in place using identical field and variable names. However, when running the package it does not update the relevant log entry with the end time and status.
 
I have performed the process manually running the stored procedures, providing the values directly and everything works fine.
 
I can only assume that the LogID variable is not being updated during the run and therefore the onEnd procedure cannot update the relevant log entry.
 
One side effect is that it does update the record when it€™s the first record entered into the table but not on any other inserts. Clearing the table each time is not an option.
 
This has become rather frustrating and would appreciate any assistance.
 
Thanks.

View Replies !   View Related
Scheduling DTS Package Using A Stored Procedure Problem
The DTS package runs fine through Enterprise manager successfully.However, when scheduled through a job that runs the dts through thefollowing code:DECLARE @findfile intExec @findfile = master.dbo.xp_cmdShell 'dir\ServerNamefolderfilename.xls', no_outputIF (@findfile=0)BEGINExec master.dbo.xp_cmdshell 'dtsrun -E -ServerInstance-N"DataImport"'ENDThe servername specified in the above statement in a different serverthan the server that the package resides on.This is the error that I get when I try to run the same code usingquery analyzer:DTSRun: Loading...DTSRun: Executing...DTSRun OnStart: DTSStep_DTSExecuteSQLTask_1DTSRun OnFinish: DTSStep_DTSExecuteSQLTask_1DTSRun OnStart: DTSStep_DTSDataPumpTask_1DTSRun OnError: DTSStep_DTSDataPumpTask_1, Error = -2147024893(80070003)Error string: The system cannot find the path specified.Error source: Microsoft Data Transformation Services (DTS) PackageHelp file: sqldts80.hlpHelp context: 1100Error Detail Records:Error: -2147024893 (80070003); Provider Error: 0 (0)Error string: The system cannot find the path specified.Error source: Microsoft Data Transformation Services (DTS) PackageHelp file: sqldts80.hlpHelp context: 1100Error: -2147024893 (80070003); Provider Error: 0 (0)Error string: Cannot open a log file of specified name. The systemcannot find the path specified.Error source: Microsoft Data Transformation Services (DTS) PackageHelp file: sqldts80.hlpHelp context: 4700DTSRun OnFinish: DTSStep_DTSDataPumpTask_1Error: -2147220440 (80040428); Provider Error: 0 (0)Error string: Package failed because Step'DTSStep_DTSDataPumpTask_1' failed.Error source: Microsoft Data Transformation Services (DTS) PackageHelp file: sqldts80.hlpHelp context: 700NULLThe job is owned by the SQLService account(Windows account) that hasSystem Admin rights and also is part of the Domain Admin User group.The Domain Admin User group has full rights on the file that the DTS istrying to access.Any help in trying to figure out why the schedule job cannot find thefile path would be appreciated.ThanksKR

View Replies !   View Related

Copyright © 2005-08 www.BigResource.com, All rights reserved