NB -- VISAKH has a better way of doing this!!!!I posted a script a while ago to recompile all functions and sprocs. It builds a table containing all the sql text for each object as it does.I've edited it to just get all the text instead and added views to the list. Hope it helps/*** Extract SQL text for all user functions and procs **************************** Charlie (2010-Feb-18)********************************************************************************/SET NOCOUNT ONDECLARE @object VARCHAR(MAX)DECLARE @type VARCHAR(2)DECLARE @text VARCHAR(MAX)DECLARE @error INTIF OBJECT_ID('tempdb..#sqlText') IS NOT NULL DROP TABLE #sqlTextIF OBJECT_ID('tempdb..#objects') IS NOT NULL DROP TABLE #objectsCREATE TABLE #sqlText ( [Id] INT IDENTITY(1,1) , [line] NVARCHAR(255) )CREATE TABLE #objects ( [name] VARCHAR(255) , [type] VARCHAR(255) , [text] VARCHAR(MAX) )DECLARE recCursor CURSOR LOCAL READ_ONLY FORSELECT [name] , [type]FROM sys.ObjectsWHERE [Type] IN ('P', 'FN', 'V') AND [is_MS_shipped] = 0OPEN recCursor FETCH NEXT FROM recCursor INTO @object, @type WHILE ( @@FETCH_STATUS = 0 ) BEGIN -- display the object RAISERROR(@object, 0 ,1) WITH NOWAIT SET @text = '' TRUNCATE TABLE #sqlText -- Get the TSQL for the current object INSERT #sqlText EXEC sp_helpText @object -- Concatenate all lines together into a dynamic SQL string SELECT @text = @text + [Line] FROM #sqlText ORDER BY [Id] ASC -- Tidy up multiple spaces WHILE ( CHARINDEX(' ', @text) > 0 ) SET @text = REPLACE(@text, ' ', ' ') -- Change the CREATE x TO ALTER x SELECT @text = REPLACE(@text, 'CREATE PROCEDURE', 'ALTER PROCEDURE') SELECT @text = REPLACE(@text, 'CREATE FUNCTION', 'ALTER FUNCTION') -- Put the object into our list INSERT #objects ([name], [type], [text]) SELECT @object, @type, @text FETCH NEXT FROM recCursor INTO @object, @type ENDCLOSE recCursorDEALLOCATE recCursor-- do your seach hereSELECT * FROM #objects