GilaMonster (12/23/2012)
Dynamic SQL (watch for SQL injection) or a string splitter function. I recommend the latter. Search this site for 'Delimited8kSplit'
Here's the link for the DelimitedSplit8K splitter.
http://www.sqlservercentral.com/articles/Tally+Table/72993/
If you need something more sophisticated or need to handle something longer than 8K bytes, I strongly recommend a CLR.
--Jeff Moden
Change is inevitable... Change for the better is not.