Posts
391
Comments
137
Trackbacks
0
Für's Archiv: Muster stored procedure

Für mein Archiv hier eine Muster für eine stored procedure:

CREATE

AS

PROCEDURE Example BEGIN

   Declare @Kundennr varchar(30)
   Declare @CumulY Decimal(15,2
)
   Declare @CumulYminus1 Decimal(15,2)

   set nocount on

   declare  #Cur Cursor forward_Only for    select * from tabelle #Cur

   open   #Cur
   Fetch next from #Cur Into @Kundennr    

   while @@fetch_Status = 0

   begin       
      -- do something
 
   end

   close  #Cur 
   deallocate  #Cur

END


   
posted on Wednesday, October 04, 2006 11:56 AM Print
Comments
No comments posted yet.

Post Comment

Title *
Name *
Email
Url
Comment *  
Please add 7 and 5 and type the answer here: