This file contains 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 |
This file contains 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 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 |