amalanto (2/25/2010)
Thank you sir.Right now We have achieved by calling UDF.I want to know whether is it poassible through stored procedure.
Create Function dbo.Result(@TranId int)
Returns @t Table(@col1 varchar(10),@col2 Datetime)
Begin
Insert into @t select Status,Date from TransHistory where Transactionid=@TranId
return
end
not enough info; your function above returns a table of values based on a single Transactionid;
we need to know what the "outer" procedure is doing to help you; is it calling this function multiple times?
if it is, you should remove the function and do a JOIN in the "outer" procedure instead. you never want to use a function to get similar data multiple times.
Lowell