Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help executing a stored procedure in DTS

Status
Not open for further replies.

alarge23

Programmer
Oct 26, 2003
50
US
I am new to DTS and need help trying to execute a stored procedure in my DTS package. My sp creates a temporary table which I need to reference later in the DTS package.

I have tried executing the sp in a 'Execute SQL Task' but when I try to SELECT records from the temp table (in a later step)it says the Table doesn't exist. What I am doing wrong?

My stored procedure....
CREATE PROCEDURE dbo.sp_test
AS
SET NOCOUNT ON
CREATE TABLE ##SOME_TABLE
(
Description varchar(50) not null,
Lastnam varchar(30) not null,
Firstnam varchar(30) not null,
Entered varchar(5) not null,
Worked varchar(5) not null,
LT_24 varchar(5) not null,
GT_24 varchar(5) not null,
First_Level varchar(5) not null
)
<sql code...>
INSERT INTO ##some_table
VALUES (@Description, @Lastnam, @Firstnam, Convert (varchar, @Number_Entered), Convert(varchar, @Number_Closed),
Convert(varchar, @First_Level_Temp), Convert(varchar, @Number_Lt24), Convert(varchar, @Number_Gt24))

 
have you tried tempdb.dbo.##some_table

another option is to create a normal table on the fly, insert into it, then at the step you select from it at the end drop the normal table.

 
Thanks, referencing it as tempdb.dbo.##some_table works!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top