That looks great, but am I correct in saying that it creates an actual new table. I only need the table inside the sproc and then I'm done with it. I'd like to avoid using a #temptable and make use of a table datatype. looks like that isn't going to happen.