USP_STATE_GETABBREVIATIONLIST
Gets a list of state abbreviations.
Parameters
Parameter | Parameter Type | Mode | Description |
---|---|---|---|
@COUNTRYID | uniqueidentifier | IN | |
@INCLUDEINACTIVE | bit | IN |
Definition
Copy
create procedure dbo.USP_STATE_GETABBREVIATIONLIST(@COUNTRYID uniqueidentifier, @INCLUDEINACTIVE bit)
as begin
if dbo.UFN_GETLISTSORTMETHOD('STATE') = 0 begin
if @INCLUDEINACTIVE = 0 begin
if @COUNTRYID is null
select ID, ABBREVIATION AS DESCRIPTION from dbo.STATE where (ACTIVE = 1) order by ABBREVIATION
else
select ID, ABBREVIATION AS DESCRIPTION from dbo.STATE where (COUNTRYID = @COUNTRYID) and (ACTIVE = 1) order by ABBREVIATION
end else begin
if @COUNTRYID is null
select ID, ABBREVIATION AS DESCRIPTION from dbo.STATE order by ABBREVIATION
else
select ID, ABBREVIATION AS DESCRIPTION from dbo.STATE where (COUNTRYID = @COUNTRYID) order by ABBREVIATION
end
end else begin
if @INCLUDEINACTIVE = 0 begin
if @COUNTRYID is null
select ID, ABBREVIATION AS DESCRIPTION from dbo.STATE where (ACTIVE = 1) order by SEQUENCE
else
select ID, ABBREVIATION AS DESCRIPTION from dbo.STATE where (COUNTRYID = @COUNTRYID) and (ACTIVE = 1) order by SEQUENCE
end else begin
if @COUNTRYID is null
select ID, ABBREVIATION AS DESCRIPTION from dbo.STATE order by SEQUENCE
else
select ID, ABBREVIATION AS DESCRIPTION from dbo.STATE where (COUNTRYID = @COUNTRYID) order by SEQUENCE
end
end
end