• rootfixxxer (1/17/2013)


    Never used ITVF before, so how do i replace my function by the ITVF? 😀

    without the code i mentioned previously, it's really hard to guess;

    since i cannot test this, it might give you an idea;

    you use a CROSS APPLY with an ITVF:

    UPDATE MyTable

    SET

    MyTable.qt = @qtDay + qt,

    MyTable.ids = ids + ',' + CAST(@id AS NVARCHAR(15))

    FROM @TableDates MyTable

    CROSS APPLY dbo.CheckDayType_ITVF(DATEADD(DAY,N-1,dt)) myfn

    WHERE pac = @pac

    AND myfn = 0

    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!