An attribute can be specified to be an ID type attribute. Attributes specified as IDREF or IDREFS can then be used to refer to the ID type attributes, thus enabling intradocument links.
ID, IDREF, and IDREFS correspond to PK/FK (primary key/foreign key) relationships in the database, with few differences. In the XML document, the values of ID type attributes must be distinct. If you have CustomerID and OrderID attributes in an XML document, these values must be distinct. However, in a database, CustomerID and OrderID columns can have the same values (for example, CustomerID = 1 and OrderID = 1 are valid in the database).
For the ID, IDREF, and IDREFS attributes to be valid:
If an XML document contains multiple IDs, to ensure the values are unique, sql:id-prefix annotation is used. For more information about sql:id-prefix, see Using sql:id-prefix.
IIS Virtual Directory Management for SQL Server