Category: sql server

  • Further refined version of code searching

    I have now included views in the search code version. Both functions now return the object type the result was found in. –Searches stored procedures, functions and views for code– containing the stringtosearchCREATE FUNCTION findTextInCode (@StringToSearch varchar(100))RETURNS @fNames TABLE (search varchar(100), name sysname, type char(2))ASBEGIN SET @StringToSearch = ‘%’ + @StringToSearch +’%’ INSERT @fNames SELECT…

  • Functions to find text in column names and in stored procedures and function definitions

    Implemented in SQL Server:This function finds a text string in a stored procedure or function definition: CREATE FUNCTION Find_Text_In_SP_or_FN (@StringToSearch varchar(100))RETURNS @fNames TABLE (name sysname)ASBEGIN SET @StringToSearch = ‘%’ + @StringToSearch +’%’ INSERT @fNames SELECT DISTINCT SO.Name FROM sysobjects SO (NOLOCK) INNER JOIN syscomments SC (NOLOCK) on SO.ID = SC.ID AND (SO.Type = ‘P’ OR…