Files
2026-07-12 13:56:05 +04:00

15 lines
451 B
Transact-SQL

USE [Database]
IF OBJECT_ID('[Procedures].[insert_attribute]', 'P') IS NOT NULL
DROP PROCEDURE [Procedures].[insert_attribute];
GO
CREATE PROCEDURE [Procedures].[insert_attribute]
@name AS NVARCHAR(128),
@inserted_attribute_id AS INT = NULL OUTPUT
AS
BEGIN TRANSACTION;
INSERT INTO [Tables].[attributes]([name])
VALUES (@name);
SET @inserted_attribute_id = SCOPE_IDENTITY();
COMMIT TRANSACTION;
GO