This script will help us to retrieve metadata/column information from a SQL Statement and/or a Table. Download this script, RETRIVE_METADATA_SCRIPT.sql.
This script
will provide the below information ..
- TABLE_OWNER
- ORDINAL_POSITION
- COLUMN_NAME
- TYPE_NAME
- LENGTH
- PRECISION
- IS_NULLABLE
See the below
table to understand parameters …
Parameter Name
|
Type
|
IN/OUT
|
Description
|
@SQLStm
|
VARCHAR(MAX)
|
INPUT
|
Put fully
qualified table name, i.e. [dbo].[TEST], luckily you can use DB
name with table name, i.e. [TEST_DB].[dbo].[TEST].
OR you can pass a SQL statement to check duplicate output, i.e. "select * from [dbo].[TEST]" |
@isTable
|
BIT
|
INPUT
|
Mention @SQLStm contains
a Table name or SQL stm. TRUE for table and FALSE
for SQL Stm.
|
No comments:
Post a Comment