Arun replies:

Take a look at the following stored procedure:

USE pubs
IF EXISTS (SELECT name FROM sysobjects
WHERE name = 'titles_cursor' and type = 'P')
DROP PROCEDURE titles_cursor
GO
CREATE PROCEDURE titles_cursor titles_cursor CURSOR
VARYING OUTPUT
AS
SET titles_cursor = CURSOR
FORWARD_ONLY STATIC FOR
SELECT *
FROM titles

OPEN titles_cursor
GO

For more information go to books online 'create procedure
t-SQL reference


>-----Original Message-----
>hi All
>How can I return a user defined cursor from a sp?
>
>thanks
>
>
>.
>