• and a simple cross apply example:

    with myCTE(val)

    AS

    (

    SELECT 'Heavy rains that fell across the Upper Mississipp' UNION ALL

    SELECT 'i River Basin in the summer of 2007 were responsi' UNION ALL

    SELECT 'ble for the Federal Emergency Management Agency (' UNION ALL

    SELECT 'FEMA) 1771-DR-IL disaster declaration. These sam' UNION ALL

    SELECT 'e rains caused significant flooding in southeaste' UNION ALL

    SELECT 'rn Minnesota, eastern Iowa, southern Wisconsin an' UNION ALL

    SELECT 'd northern Illinois. Large portions of northern ' UNION ALL

    SELECT 'Illinois received between 125 and 175 inches of r' UNION ALL

    SELECT 'ain during this period, and this, combined '

    )

    select val,a.val2

    FROM MyCTE

    CROSS APPLY (SELECT REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(val, 'A', ''), 'E', ''), 'O', ''), 'U', ''), 'I', '') as val2

    ) a

    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!