views:

17

answers:

1

Hello, sorry for the poorish description it is really hard to explain what I am trying to do. But this is some pseudo:

foreach (row in Table1)
    insert Table2 select * from getValuesTable('text', row.Column1)

I'm not too sure how to get that initial join together because it will not allow me to alias the returned table from getValuesTable. Any help would be appreciated :) Thanks.

+2  A: 

You can use Cross Apply to execute the function for each row in Table1

Insert Table2(...)
Select ...
From Table1
    Cross Apply GetTableValues('text',Table1.Column1)
Thomas
Ah okay, I see Thanks!
Sam F
Oh wow never seen "Cross Apply" before. Learned something new
AaronLS
Yeah same here.
Sam F