lunedì 3 dicembre 2012

Cursore


 Declare @EmpId int
Declare c Cursor For Select Distinct Employee_id From TableName
Open c

Fetch next From c into @EmpId


While @@Fetch_Status=0 Begin
   ... do whatever you want ...
   Fetch next From c into @EmpId
End


Close c
Deallocate c

Nessun commento: