Thulasiram pakala

Thulasiram pakala

  • 844
  • 838
  • 105.3k

scope identity want to add 'CM00'

Apr 28 2021 2:27 AM
scope identity want to add 'CM00' that value not null then want to insert other table
 
in this process id @ProcessID want add this string 'CM00' and insert to this value in other table eg CM0001 like tha
 
ALTER PROCEDURE [dbo].[Insert_Header_Details_Tables](@ProcessID [int]=null, @FileName [varchar](50)=null,@VendorName [varchar](250)=null, @LastName [nvarchar](100)=null,@FirstName [nvarchar](100)=null,@isFirstMSH [bit])
AS --BEGIN TRANSACTION -- Insert into Jobs table
IF(@isFirstMSH = 1)
BEGIN INSERT INTO LabStagingHeader([FileName], [VendorName] ) VALUES (@FileName,@VendorName)
END -- Retrieve the automatically @ProcID VALUE from the Header table SET @ProcessID = SCOPE_IDENTITY()-- Insert new values into LabStagingDetails table INSERT INTO LabStagingDetails ([ProcessID],[LastName],[FirstName] ) VALUES (@ProcessID, @LastName,@FirstName)