sql - How can I take values From a table which is output of a function in a stored procedure -


this statement inside stored procedure gives table output contains date dt:

select [dt]    dbo.fngetdatesforweekdays(@dafromdate, @datodate, @wkdays) dat 

how can take date values 1 one?

if need process them 1 one you'll need use cursor , loop through cursor:

declare @dt datetime  declare date_cursor cursor select [dt]     dbo.fngetdatesforweekdays(@dafromdate, @datodate, @wkdays) dat   open date_cursor  fetch next date_cursor @dt  while @@fetch_status <> -1 begin --do processing here  fetch next date_cursor @dt  end  close date_cursor  deallocate date_cursor 

just whatever want each of dates comment , you're go.


Comments

Popular posts from this blog

android - Spacing between the stars of a rating bar? -

aspxgridview - Devexpress grid - header filter does not work if column is initially hidden -

c# - How to execute a particular part of code asynchronously in a class -