Sp_columnsXML
- Last UpdatedNov 02, 2023
- 1 minute read
The sp_columnsXML stored procedure lists all the columns (fields) within a table and database. You can use the Microsoft SQL wildcard character "%" for the table and column parameters, but not for the database parameter.
Syntax
sp_columnsXML(‘<database>’,’<table>’,’<column>’)
Example 1
call sp_columnsXML(‘RTDB’,’%’,’%’);
Output
Lists all the columns of all the tables in the RealTime database (RTDB).
Example 2
call sp_columnsXML (‘RTDB’,’analog’,’%’);
Output
Lists all the columns of the analog table.
Example
call sp_columnsXML(‘RTDB’,’message’,’name’);
Output
Lists the name column of the message database.
<?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">
<column name="name" datatype="string" description="Message key name" length="15" nullable="no" casesensitive="no" defaultvalue="yes" />
</table>
</database>
</OASyS DNASQLEngineSchema>