USE [AIADatabaseV5]
GO
/****** Object:  StoredProcedure [dbo].[usp_InsertExportedImage]    Script Date: 9/16/2019 10:39:34 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

-- =============================================
-- Developer:	<Birendra Kumar>
-- Create date: <8/05/2018>
-- Application :AIAHTML5
-- Description:	<Insert exported image  based on user id and License Id>
--  [dbo].[usp_InsertExportedImage] 42374,34148,'pqr','124.jpg','male enterior','DA'

-- =============================================
CREATE PROCEDURE [dbo].[usp_InsertExportedImage]
	-- Add the parameters for the stored procedure here
	@UserId INT,@LicenseId INT,@ImageName nvarchar(2000),@OriginalFileName nvarchar(1000),@Title nvarchar(1000),@ModuleName nvarchar(1000)
AS
BEGIN
	-- SET NOCOUNT ON added to prevent extra result sets from
	SET NOCOUNT ON;
		BEGIN TRY
		BEGIN TRANSACTION
DECLARE @InsertMessage char(2);
DECLARE @Id INT;
SET @InsertMessage='OK';
   

 INSERT INTO LicenseImageExportDetail (LicenseId,ImageName,ExportedDate,UserId,OriginalFileName,Title,ModuleName) 
					VALUES( @LicenseId, @ImageName,GETDATE(),@UserId,@OriginalFileName,@Title,@ModuleName)

COMMIT
		SELECT @InsertMessage as SPStatus ;
   END TRY
	BEGIN CATCH
		IF @@TRANCOUNT > 0 
			ROLLBACK TRANSACTION
		SELECT Error_Message() as SPStatus
	END CATCH

END
GO
