sp_tablesXML
- Last UpdatedNov 02, 2023
- 1 minute read
This stored procedure will list information about all the tables within either the specified database (or "qualifier") or all databases. Use the Microsoft SQL wildcard character % instead of a database name to specify all databases. The output is in XML format.
call sp_tablesXML(<database>)
call sp_tablesXML('RTDB');
<?xml version="1.0" standalone="no">
<SQLEngineDatastoreSchema>
<database name="RTDB" owner="dbo">
<table name="XIS_sync_trans" owner="dbo" description="XIS
Synchronous Transaction Queue" allowUpdate="yes" allowSelect="yes" allowDelete="yes" allowInsert="yes" tablelastmodified="10/10/2013 10:01:28.839"permissionslastmodified="10/10/2013 10:01:28.839">
</table>
<table name="tag" owner="dbo" description="a
device tag" allowUpdate="yes" allowSelect="yes" allowDelete="yes" allowInsert="yes" tablelastmodified="10/10/2013 10:01:28.449 permissionslastmodified="10/10/2013 10:01:28.449">
</table>
...
<table name="DevSpooler" owner="dbo" description="Device Spooler Sequence Table" allowUpdate="yes" allowSelect="yes" all=""owDelete="yes" allow Insert="yes" tablelastmodified="10/10/2013 10:01:28.839"permissionslastmodified="10/10/2013 10:01:28.839">
</table>
</database>
</SQLEngineDatastoreSchema>