Environment: SQL Server 2005/2008, pubs database
I have inserted into a table variable a set of data as shown below using information
It's a loop or a function as you suggested (which is really a loop anyway).