Stored Procedures [dbo].[GetCountryCodeStandards]
Properties
PropertyValue
ANSI Nulls OnYes
Quoted Identifier OnYes
Permissions
TypeActionOwning Principal
GrantExecuteMssExec
SQL Script
/*
* Retrieves the country code standard data for MoversSuiteApi consumption.  USA is always returned first.
*/

CREATE PROCEDURE [dbo].[GetCountryCodeStandards]
AS
begin
    set nocount on

    select
        CountryCodeStandard.CountryCodeStandardID,
        CountryCodeStandard.CountryName,
        CountryCodeStandard.Alpha2Code,
        GroupID = case CountryCodeStandard.Alpha2Code
            when 'US' then 1
            else 2
        end
    from CountryCodeStandard
    order by GroupID asc, CountryCodeStandard.CountryName asc
end
GO
GRANT EXECUTE ON  [dbo].[GetCountryCodeStandards] TO [MssExec]
GO
Uses