Home Forums SQL Server 7,2000 T-SQL Scalar function result into temp table column RE: Scalar function result into temp table column

  • doug.davidson (4/8/2013)


    I have never explored a CTE before. Good new research and learning for me.

    I will use the sub select as the new work around until I finish my learning on the CTE approach.

    Thanks for you time everyone.

    just noticed the forum was SQL2000, so here's the same thing as a sub select, if it wasn't obvious how to convert the first example:

    update rmc

    set rmc.sla_target_date = dbo.fn_GetTargetTimeInServiceHours(rmc.project_id, rmc.folder_id, rmc.sla_start_date, (rmc.hold_time + @target_time))

    from #request_meet_criteria rmc

    INNER JOIN (

    SELECT rmc.*,

    NewTargetDate = dbo.fn_GetTargetTimeInServiceHours(rmc.project_id, rmc.folder_id, rmc.sla_start_date, (rmc.hold_time + @target_time))

    FROM #request_meet_criteria rmc

    rmc.smx_active_flag = 0

    ) myIntermediateResults

    ON rmc.project_id = myIntermediateResults.project_id

    AND rmc.request_id = myIntermediateResults.request_id

    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!