Re: How to define cursor on temp table?
From: Partha Mandayam (mcp111_at_hotmail.com)
Date: 08/24/04
- Next message: Ian Frawley: "SQL Server monitoring"
- Previous message: Jacco Schalkwijk: "Re: datetime fields"
- In reply to: Snake: "How to define cursor on temp table?"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 24 Aug 2004 08:52:35 -0700
I have used local temp tables successfully in a cursor.
Check this out.
select top 10 claimid, startdate into #temp
from claim
DECLARE cur1 CURSOR
FOR select * from #temp
DECLARE @claimid varchar(15)
DECLARE @startdate datetime
OPEN cur1
FETCH NEXT FROM cur1 INTO @claimid, @startdate
WHILE (@@fetch_status <> -1)
BEGIN
IF (@@fetch_status <> -2)
BEGIN
PRINT 'claimid'
-- eg.
END
FETCH NEXT FROM cur1 INTO @claimid, @startdate
END
CLOSE cur1
DEALLOCATE cur1
GO
Regards
Partha Mandayam
Software Consultant
Home page: http://partha.tripod.com
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
- Next message: Ian Frawley: "SQL Server monitoring"
- Previous message: Jacco Schalkwijk: "Re: datetime fields"
- In reply to: Snake: "How to define cursor on temp table?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|