Information générale
Forum:
Microsoft SQL Server
Catégorie:
Stored procedures, Triggers, UDFs
If I understand your question...Try this:
1- Put the variable '@Result' like a new parameter with the 'Output' at the end
2- and check the execution at the end
================================================
CREATE PROCEDURE AAA
@COLNUM smallint,
@RESULT varchar(100) output
AS
DECLARE @TESTFIELD varchar(100)
set @TESTFIELD = COL_NAME(OBJECT_ID('Northwind.dbo.Employees'),@COLNUM )
DECLARE Employee_Cursor CURSOR FOR
SELECT @TESTFIELD FROM Northwind.dbo.Employees
OPEN Employee_Cursor
FETCH NEXT FROM Employee_Cursor into @RESULT
CLOSE Employee_Cursor
DEALLOCATE Employee_Cursor
/* When you will excute your SP
declare @x datetime
set @x = null
execute aaa 1, @x output
select @x
*/
Dave
Technologies Nter
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement