Files
DP44/DataPRO_sql/dbo.Alter_sp_GroupsInsert.sql
2026-04-17 14:55:32 -04:00

37 lines
2.0 KiB
Transact-SQL
Raw Permalink Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
USE [DataPro]
GO
/****** Object: StoredProcedure [dbo].[sp_GroupsInsert] Script Date: 22/03/2019 15:37:54 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[sp_GroupsInsert]
@SerialNumber NVARCHAR (255),
@Picture NVARCHAR (255) = NULL,
@DisplayName NVARCHAR (255),
@Embedded BIT,
@Description NVARCHAR (255),
@LastModified DATETIME,
@LastModifiedBy NVARCHAR (255),
@StaticGroupId int = NULL,
@errorNumber int OUTPUT,
@errorMessage NVARCHAR (255) OUTPUT,
@new_id int OUTPUT
AS
BEGIN
SET NOCOUNT ON;
SET @errorNumber=0
SET @errorMessage=''
INSERT INTO Groups (SerialNumber, [Picture], DisplayName, [Description], Embedded, LastModified, LastModifiedBy, StaticGroupId)
VALUES (@SerialNumber, @Picture, @DisplayName, @Description, @Embedded, @LastModified, @LastModifiedBy, @StaticGroupId)
SET @new_id = scope_identity();
IF(@@error != 0)
BEGIN
SET @errorNumber = error_number()
SET @errorMessage = error_message()
END
END