• 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


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!