Using SQL Server 2000...
I would like to compare the contents of user-defined stored procedures in two databases, outputting their names and colid values. The procedures have the same names in the databases. So I tried the obvious coding of:
That resulted in the error message "Server: Msg 8648, Level 17, State 95, Line 1
Could not insert a row larger than the page size into a hash table. Resubmit the query with the ROBUST PLAN hint."
So I added "OPTION (ROBUST PLAN)", executed it, and got the error message "Server: Msg 8619, Level 16, State 2, Line 1
Warning: The query processor could not produce a query plan from the optimizer because the total length of all the columns in the GROUP BY or ORDER BY clause exceeds 8000 bytes. Resubmit your query without the ROBUST PLAN hint."
Suggestions?
(I believe I could get it to work by comparing only one value of colid per query, and doing a UNION of those queries. But that's kludgey, some of the stored procs use colid values up to 15, and could go higher.)
I would like to compare the contents of user-defined stored procedures in two databases, outputting their names and colid values. The procedures have the same names in the databases. So I tried the obvious coding of:
Code:
SELECT O1.name, C1.colid
FROM DB1.dbo.sysobjects O1
INNER JOIN DB1.dbo.syscomments C1
ON O1.id = C1.id
WHERE O1.xtype = 'P'
AND O1.category <> 2
AND C1.text <>
(SELECT C2.text
FROM DB2.dbo.sysobjects O2
INNER JOIN DB2.dbo.syscomments C2
ON O2.id = C2.id
AND C2.colid = C1.colid
AND O2.name = O1.name
WHERE O1.xtype = 'P'
AND O1.category <> 2
)
;
Could not insert a row larger than the page size into a hash table. Resubmit the query with the ROBUST PLAN hint."
So I added "OPTION (ROBUST PLAN)", executed it, and got the error message "Server: Msg 8619, Level 16, State 2, Line 1
Warning: The query processor could not produce a query plan from the optimizer because the total length of all the columns in the GROUP BY or ORDER BY clause exceeds 8000 bytes. Resubmit your query without the ROBUST PLAN hint."
Suggestions?
(I believe I could get it to work by comparing only one value of colid per query, and doing a UNION of those queries. But that's kludgey, some of the stored procs use colid values up to 15, and could go higher.)