usp_InsertExportedImage.sql
1.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
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