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 |