This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /******************************************************************************************** | |
| SQL Server Source Code Search Utility | |
| ------------------------------------- | |
| Searches SQL object definitions (procedures, views, functions, triggers) | |
| for specific text patterns, allowing inclusion and exclusion of both: | |
| • Text within object definitions | |
| • Object names | |
| Features: | |
| • Supports multiple comma-separated values for each category |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| DECLARE @strSQL nvarchar(1000) | |
| IF NOT EXISTS (SELECT * FROM dbo.sysobjects where id = OBJECT_ID(N'[dbo].[GetFieldStringTruncate]')) | |
| BEGIN | |
| SET @strSQL = 'CREATE PROCEDURE [dbo].[GetFieldStringTruncate] AS RETURN' | |
| EXEC sys.sp_executesql @strSQL | |
| END | |
| GO | |
| SET ANSI_NULLS ON |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| DECLARE @NameStoreProcedure AS VARCHAR(100) = 'Name_of_store_procedure' --Do not place the scheme | |
| IF NOT EXISTS (SELECT * FROM dbo.sysobjects where id = OBJECT_ID(@NameStoreProcedure)) | |
| BEGIN | |
| SELECT 'Invalid store procedure name ' + @NameStoreProcedure | |
| RETURN | |
| END | |
| IF OBJECT_ID('tempdb..#Positions') IS NOT NULL | |
| DROP TABLE #Positions |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| DECLARE @strSQL NVARCHAR(1000) | |
| IF NOT EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[TRY_CAST]')) | |
| BEGIN | |
| SET @strSQL = 'CREATE FUNCTION [dbo].[TRY_CAST] () RETURNS INT AS BEGIN RETURN 0 END' | |
| EXEC sys.sp_executesql @strSQL | |
| END | |
| SET ANSI_NULLS ON | |
| GO | |
| SET QUOTED_IDENTIFIER ON |