I would like to create a view in SQL Server that combines several pieces of database metadata.
One piece of metadata that I want to live in the sys.syscomments table is the corresponding columns:
id colid text
As you can see, the data in the βtextβ column is divided into several rows if it skips the maximum length (8000 bytes / 4000 characters in SQL Server, 12 characters in my example). colid identifies the assembly order of the text back.
I would like to make a query / subquery in my opinion to collect comments from the sys.syscomments table, so I have:
id comment (nvarchar(max))
Any suggestions or solutions? Speed ββis by no means critical, but simplicity and low impact (I would like to avoid CLR functions and the like - ideally, all this would be wrapped in the definition of a view). I looked at some XML-based suggestions, but as a result, you got text filled with lines of XML escape code.
sql sql-view sql-server-2005 concatenation
David
source share