Files
the-biergarten-app/DataLayer/scripts/02-functions/UDF_GetCountryIdByCode.sql
2026-01-13 20:10:39 -05:00

16 lines
281 B
Transact-SQL

CREATE OR ALTER FUNCTION dbo.UDF_GetCountryIdByCode
(
@CountryCode NVARCHAR(2)
)
RETURNS UNIQUEIDENTIFIER
AS
BEGIN
DECLARE @CountryId UNIQUEIDENTIFIER;
SELECT @CountryId = CountryID
FROM dbo.Country
WHERE ISO3616_1 = @CountryCode;
RETURN @CountryId;
END;