format sql

This commit is contained in:
Aaron Po
2026-08-04 05:33:43 -04:00
parent 1d1edd37d0
commit f3f704da8d
22 changed files with 373 additions and 425 deletions

View File

@@ -1,26 +1,24 @@
CREATE
OR
ALTER PROCEDURE dbo.USP_CreateCountry(
CREATE OR ALTER PROCEDURE dbo.USP_CreateCountry(
@CountryName NVARCHAR(100),
@ISO3166_1 NVARCHAR(2)
)
AS
)
AS
BEGIN
SET
NOCOUNT ON;
NOCOUNT ON;
SET
XACT_ABORT ON;
BEGIN
TRANSACTION;
XACT_ABORT ON;
BEGIN
TRANSACTION;
IF
EXISTS (SELECT 1
FROM dbo.Country
WHERE ISO3166_1 = @ISO3166_1)
EXISTS (SELECT 1
FROM dbo.Country
WHERE ISO3166_1 = @ISO3166_1)
THROW 50001, 'Country already exists', 1;
INSERT INTO dbo.Country
(CountryName, ISO3166_1)
VALUES (@CountryName, @ISO3166_1);
COMMIT TRANSACTION;
INSERT INTO dbo.Country
(CountryName, ISO3166_1)
VALUES (@CountryName, @ISO3166_1);
COMMIT TRANSACTION;
END;