Initial commit

This commit is contained in:
user
2026-07-12 13:56:05 +04:00
commit 04bf3a4b58
850 changed files with 9057 additions and 0 deletions
@@ -0,0 +1,22 @@
USE [Database]
IF OBJECT_ID('[Tables].[trg_insert_product_values]', 'TR') IS NOT NULL
DROP TRIGGER [Tables].[trg_insert_product_values];
GO
CREATE TRIGGER [Tables].[trg_insert_product_values] ON [Tables].[product_values] AFTER INSERT
AS
IF EXISTS(
SELECT *
FROM (
SELECT [i].[value], COUNT(*) AS [count]
FROM [Tables].[product_values] AS [PV]
JOIN [inserted] AS [i]
ON [i].[id] = [PV].[product_id]
) AS [values]
WHERE [count] > 1
)
BEGIN
ROLLBACK TRANSACTION;
RETURN;
END
GO