Quick background for those interested,
I have a master detail table(options date), about 20 details for each master record. Our oltp system that is saving the data was doing 21 inserts for each new piece of information we saved. This was killing the server, so I'm trying to get this working by substituting comma separated values for the details table. Everything seems to be working, except I can figure out how to get the details table back. I'm trying to use table valued funtions, and it's not quite working.
I'd like to call something like
Select Top 100 *
FROM dbo.fn_MarketDataDetails (MarketDataMasterID) mdd
INNER JOIN MarketDataMaster mdm on mdm.MarketDataMasterID = mdd.MarketDataMasterID
Clearly, that just doesn't compile.
I can run
Select Top 100 *
FROM dbo.fn_MarketDataDetails (15425) // Assuming 15425 is a valid MarketDataMasterID
And I get back a table that looks like my old details table.
Is this even possible? Am I making any sense?