Greg and I have already discussed this but I wanted to continue the discussion here for the benefit of other SF developers :
In SQL2008 the Table View Parameter has added an incredibly powerful tool for passing parameters into T-SQL sprocs. An old friend, Kevin Goff, has written some very good stuff for Code Magazine on all this and he sent me some links about the topic in general and TVPs in particular
http://www.setfocus.com/TechnicalArticles/Articles/sql-server-2005-tsql-3.aspx (go down to section 5....this converts a CSV to a table variable for subsequent join operations)
http://www.code-magazine.com/Article.aspx?quickid=0709031 (listings 12 and 13....this converts an XML string to a table variable)
http://www.code-magazine.com/Article.aspx?quickid=0807041Finally, wrote about using the new table type in 2008 to pass a datatable as a parameter
(Tip #5)
This last link shows how to pass a datatable as a parameter into a sproc, where it can be used to do one big honkin' insert.
I am particularly interested in doing this with a table of keys in order to accomplish the same thing as fillbyprimarykey() using the paramarray overload.
NOTE: This is only relevant to SQL2008 and that is sql10 - spent an embarassing amount of time last night wondering why I was getting errors executing scripts, for getting the sql express db I was in ( sql9 - like vb 9 latest version, right? WRONG ) was sql2005.
Anyway, as soon as I get a complete walk-through on this done I'll post it . There is a huge amount of potential here and I'm amazed I haven't run across this solution before, though I'm sure somebody mentioned it but I just didn't get the implications at the time.