COUNTRYADDRESSFORMAT

Contains various address formats for a given countries.

Primary Key

Primary Key Field Type
ID uniqueidentifier

Fields

Field Field Type Null Notes Description
FORMATNAME nvarchar(50) Default = '' Stores the name of the address format for a given country
FORMATSQLFUNCTION nvarchar(200) Default = '' Stores the SQL function that returns that address in the given format. The function should contain the parameters (@ID uniqueidentifier, @ADDRESSBLOCK nvarchar(150), @CITY nvarchar(50), @STATEID uniqueidentifier, @POSTCODE nvarchar(12), @COUNTRYID uniqueidentifier) and returns nvarchar(250)
SEQUENCE int Default = 0 Stores the user-defined sequence for the country address format
DATEADDED datetime Default = getdate() Indicates the date this record was added.
DATECHANGED datetime Default = getdate() Indicates the date this record was last changed.
TS timestamp Timestamp.
TSLONG bigint (Computed) yes CONVERT(bigint, TS) Numeric representation of the timestamp.
FORMATSTRING nvarchar(max) Default = '' String generated by the format editor, defining the address format.

Foreign Keys

Foreign Key Field Type Null Notes Description
ADDEDBYID uniqueidentifier CHANGEAGENT.ID FK to CHANGEAGENT.
CHANGEDBYID uniqueidentifier CHANGEAGENT.ID FK to CHANGEAGENT.

Indexes

Index Name Fields Unique Primary Clustered
IX_COUNTRYADDRESSFORMAT_DATEADDED DATEADDED yes
IX_COUNTRYADDRESSFORMAT_DATECHANGED DATECHANGED
PK_COUNTRYADDRESSFORMAT ID yes yes
UC_COUNTRYADDRESSFORMAT_FORMATNAME FORMATNAME yes
UC_COUNTRYADDRESSFORMAT_FORMATSQLFUNCTION FORMATSQLFUNCTION yes

Triggers

Trigger Name Description
TR_COUNTRYADDRESSFORMAT_AUDIT_UPDATE
TR_COUNTRYADDRESSFORMAT_AUDIT_DELETE
TR_COUNTRYADDRESSFORMAT_INSERT

Referenced by

Referenced by Field
COUNTRY COUNTRYADDRESSFORMATID