I'm using MS SQL Server 2000, and I'm wondering if there is a quick way (in T-SQL) to check and see if any existing stored procedures have been broken by making large changes to the database and tables? Here's what I have tried (messy), and I figure you use sp_sproc_columns to script actually execution of the sprocs, but that would be a lot of work anticipating data types, etc.
Thanks.Code:BEGIN TRANSACTION DECLARE @name sysname DECLARE Sproc_Cursor CURSOR FOR SELECT name FROM sysobjects WHERE OBJECTPROPERTY(id, 'IsProcedure') = 1 AND category = 0 ORDER BY name OPEN Sproc_Cursor FETCH Sproc_Cursor INTO @name WHILE @@FETCH_STATUS = 0 BEGIN PRINT @name --SET FMTONLY ON --EXEC @name EXEC sp_recompile @name --SET FMTONLY OFF FETCH Sproc_Cursor INTO @name END CLOSE Sproc_Cursor DEALLOCATE Sproc_Cursor ROLLBACK TRANSACTION


Reply With Quote