I Have a Stored procedure like below
USE [AfmsBizTalkAggregationDb]GO
/****** Object: StoredProcedure [dbo].[InsertUnitItem] Script Date: 06/25/2014 22:11:23 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[InsertUnitItem]
@Item XML, @ItemType NVARCHAR (255), @CorrelationValue NVARCHAR (25)--='empty'
--Defect#92507:Removed the default parameter passed to filed @CorrelationValue
--G.Sunitha,23-May-2014
, @DoInsert BIT
AS
BEGIN
-- find typeid
declare @TypeId smallint
select @TypeId = [Id] from [ItemTypes] where Lower(@ItemType)=Lower([Name])
if(@DoInsert = 1) -- Added by HDC team to implement defect# 22502
insert into [dbo].[ItemsByType] (Item, TypeId) values (@Item, @TypeId)
Update ProcessingHistory
Set Flag = 1
where ProcessIdentifier=@CorrelationValue
END
GO
To execute this stored procedure i have to give it like
exec [dbo].[InsertUnitItem] 'xml','operationcards','98f'
but in my scenario correlation value can be null, if i give like this it should be able to execute
exec [dbo].[InsertUnitItem] 'xml','operationcards'
how can i do this?