I was writing a script that kept giving me errors. After tracking it down I found that the syscomments table stores its contents in multiple rows if the information gets to long past varchar(8000) i believe.
Why does the syscomments table break the data up into multiple rows instead of 1 single larger row? performance?
syscomments.textis nvarchar(4000) documented here:sys.syscomments (Transact-SQL), which was the best you could do back in the day.However, you can use the newer
sys.sql_modulesdocumented here: sys.sql_modules (Transact-SQL), which has adefinitioncolumn which isnvarchar(max).for searching use:
if you are pre SQL Server 2005 you can search using the query here: SQL server table population source