mirror of
https://github.com/aaronpo97/the-biergarten-app.git
synced 2026-02-16 20:13:49 +00:00
restructure seed
This commit is contained in:
22
DataLayer/scripts/03-crud/04-Location/USP_CreateCountry.sql
Normal file
22
DataLayer/scripts/03-crud/04-Location/USP_CreateCountry.sql
Normal file
@@ -0,0 +1,22 @@
|
||||
CREATE OR ALTER PROCEDURE dbo.USP_CreateCountry
|
||||
(
|
||||
@CountryName NVARCHAR(100),
|
||||
@ISO3616_1 NVARCHAR(2)
|
||||
)
|
||||
AS
|
||||
BEGIN
|
||||
SET NOCOUNT ON;
|
||||
SET XACT_ABORT ON;
|
||||
|
||||
IF EXISTS (
|
||||
SELECT 1
|
||||
FROM dbo.Country
|
||||
WHERE ISO3616_1 = @ISO3616_1
|
||||
)
|
||||
RETURN;
|
||||
|
||||
INSERT INTO dbo.Country
|
||||
(CountryName, ISO3616_1)
|
||||
VALUES
|
||||
(@CountryName, @ISO3616_1);
|
||||
END;
|
||||
Reference in New Issue
Block a user