A very nice article, though isnt there a better way of building the Column lists than using an XML?
Could you not just do this
Declare @var varchar(2000) = ''
Select @var=@var+','+COLUMN_NAME
from INFORMATION_SCHEMA.COLUMNS
Where TABLE_SCHEMA='<schema>' and TABLE_NAME ='<table>'
Select Substring(@var,2,len(@var)-2)
_________________________________________________________________________
SSC Guide to Posting and Best Practices