Sp_FKeysXML
- Last UpdatedNov 02, 2023
- 1 minute read
The sp_FKeysXML stored procedure lists the foreign keys of a table within a database. You can use the Microsoft SQL wildcard character "%" in place of the table and/or key name.
Syntax
sp_FKeysXML(‘<database>’,’<table>’,’<key>’)
Example
call sp_FKeysXML(‘db’,’message’,’%’);
Output
<?xml version="1.0" standalone="no" ?>
<OASyS DNASQLEngineSchema>
<database name="RTDB">
<table name="message" description="Message text and color"
allowUpdate="yes" allowSelect="yes" allowDelete="yes" allowInsert="yes">
<foreignkey name="name" primarycolumn="name" foreigndatabase="" foreigntable="" foreigncolumn="" sequence="1" />
</table>
</database>
</OASyS DNASQLEngineSchema>