Showing posts with label urgent. Show all posts
Showing posts with label urgent. Show all posts

Monday, March 26, 2012

EXECUTING A STRING (URGENT HELP PLEASE)

Dear friends,
i have a problem here that as much as i go through it looks worth.
I have build a dynamic query with a string like below:
[blue]
CREATE PROCEDURE PROC1
AS
DECLARE @.TempQString nvarchar(1000)
SET @.TempQString = 'DECLARE @.resultvalue int'
SET @.TempQString =@.TempQString + 'EXEC @.resultvalue=[MyStoredProcedure]'
EXEC sp_executesql @.TempQString
GO
[/blue]
now in the body of my main stored procedure (PROC1) i want to get the
return value if the [MyStoredProcedure] that was executed through a string!!!!!!!!!!
i've tried to insert the return value in a temp table (#table)
but this also didnt work, cuz out of the string execution my temp table was dropped!! also i cant use a global temp table (##table)
because many users may execute the PROC1 at the same time!!
[red]PLEASE HELP THIS IS VERY IMPORTANT FOR ME[/red]

Firstly I have to question why you are execution your stored procedures in this way as it doesn't seem to be particularly efficient. Is there another way you can perform the task?

If you still need to use this method then try the example below.

Chris

Code Snippet

CREATE PROCEDURE PROC1

AS

DECLARE @.TempQString nvarchar(1000)

DECLARE @.resultvalue INT

SET @.TempQString = 'EXEC @.resultvalue=[MyStoredProcedure]'

EXEC sp_executesql @.TempQString, @.Parameters = N'@.resultvalue int output', @.resultvalue = @.resultvalue OUTPUT

RETURN ISNULL(@.resultvalue, -1)

GO

sql

Monday, March 12, 2012

Execute SQL2000 PAckage in 2005

HI ALL,

Could you please help me on this issue.It is URgent .I am new to SSIS.

I am using DTS package in SSIS. I Have an SQLTask and DTS Package. I want to fail the SSIS PAckage when DTS 2000 Package Fails. I want to know How to populate the failure of DTS PAcage to SSIS PAcage.When i execute the SSIS Package the DTSPAckage task Failed Internally but it styays yellow for ever.it is not showing red Color in SSIS Package.Any help is greatyly appreciated.

Thanks

ISANAKA

What version of SSIS are you using? What does your DTS 2000 package do? When I execute a DTS 2000 package that fails, "Execute DTS 2000 package" task fails in SSIS with the error message "Task Execute DTS 2000 Package Task failed".

May be you can double check to see if the execution of DTS 2000 package is successful in DTS.