HiI need help please.I have a sp with begin tran and commit tran that needs to insert records into 2 tables.The first table is NoticeInformation and the second insert is into TasksActionData. The primary key information_id needs to be inserted into TasksActionData column information_id.sample data inserted into NoticeInformation information_id information_details1 gli 2 cat3 dataTasksActionData ActionDataId information_id2 12 24 3sample sp:begin tryBEGIN tran --Get The id of the GLI Status from Carton StatusDECLARE @GLI AS intSET @GLI = (SELECT cartonstatus_id FROM CartonStatus WHERE (cartonstatus_name = 'GLI'))--Create a temp table to hold Temp cartons idsCREATE table #tempPLs(id int identity, packlistid nvarchar(20))--Fill the temptable with the pl ids that their status must be changedinsert into #tempPLs--Find Packlists that received GLI in the last 24 hours ie one daySELECT PackList_idFROM PackList where packlist.packlist_statusDate< DateADD(day,-1,Getdate()) ---INSERT INTO NOTICES AND TASK ACTIONDECLARE @notice_id INT if not exists (select notice_Message from notice where notice_Message='PL remains in GLI in the last 24hrs')beginINSERT INTO [nicita].[dbo].[Notice] ([notice_Message]) VALUES ('PL remains in GLI in the last 24hrs')set @notice_id=@@identityinsert into noticegroup (notice_id,groups_id)values (@notice_id,2)--finance groupendelse --notice exists already so only get notice idbeginset @notice_id=(select top 1 notice_id from notice where notice_Message='PL remains in GLI in the last 24hrs')endINSERT INTO [NoticeInformation] ([information_details] ,[information_date] ,[information_done] ,[notice_id])select 'GLI PL: ' + packlistid ,getdate(),0,@notice_idfrom #tempPLs INSERT INTO [TasksActionData] (information_id ,[Data]--PL ,[ActionId])SELECT @@identity,PACKLISTID,4 --none from #tempPLs COMMIT TRAN -- Transaction Success!CREATE TABLE [dbo].[NoticeInformation]( [information_id] [bigint] IDENTITY(1,1) NOT NULL, [information_details] [varchar](max) NULL, [information_date] [datetime] NULL, [information_done] [bit] NULL , [notice_id] [int] NOT NULLThe 2nd table is TasksActionDataCREATE TABLE [dbo].[TasksActionData]( [ActionDataId] [int] IDENTITY(1,1) NOT NULL, [information_id] [bigint] NOT NULL, [Data] [nvarchar](max) NULL, [ActionId] [int] NULLWhisky-my beloved dog who died suddenly on the 29/06/06-I miss u so much.