set ANSI_NULLS ON set QUOTED_IDENTIFIER ON go ALTER PROCEDURE [dbo].[StpCreateGridLayoutFilter] (@LayoutId int ,@Field nvarchar(1000) ,@DisplayText nvarchar(1000) ,@DisplayName nvarchar(1000) ,@FilterText nvarchar(1000) ,@IgnorDuplicate bit ) AS if @IgnorDuplicate =0 if exists(SELECT LayoutId FROM GridLayOutFilterTbl WHERE LayoutId = @layoutid AND DisplayName = @DisplayName ) begin raiserror (50801,16,1) return 1 end INSERT INTO [dbo].[GridLayOutFilterTbl] ([LayoutId] ,[Field] ,[DisplayText] ,[DisplayName] ,[FilterText]) VALUES (@LayoutId ,@Field ,@DisplayText ,@DisplayName ,@FilterText)