/******* columns explorer *******/
/* Goal: returns info about each column constraint and indexes
Scope: current database
Use: execute script
---------------- result set ----------------
schemaName (nvarchar): current table schema
tableName (sysname): current table name
columnName (sysname): current column name
dataType (sysname): current column data type
maxLegth (smallint): current column data max lenght
precision (tinyint): current column data precison
scale (tinyint): current column data scale
collationName (sysname): current column collation name
isIdenty (bit): if current column is an identity column
isNullable (bit): if current column allows Null values
isFkTable (bit): if current table has foreign keys
isFkColumn (bit): if current column is a foreign key column
isPkTable (bit): if current table has a primary key
isPkColumn (bit): if current column is a primary key column
colOrderInPK (tinyint): current column ordinal in the primary key definition
isIndexedColumn (bit): if current colum is indexed
indexName (sysname): index name to which the current column belongs
indexType (varchar): index type to which the current column belongs
isUniqueIndex (bit): if [indexName] is a unique index
isUniqueConstraint (bit): if [indexName] is a unique index
idxColOrder (tinyint): current column ordinal in the [indexName] definition
hasDefault (bit): if current column has a default constraint
hasTableCheck (bit): if there's a table check constraint
hasColumnCheck (bit): if current column table check constraint
foreignKeyName (sysname): foreign key to which current column belongs
fkColumns (nvarchar): all columns of the [foreignKeyName] constraint
pkTableName (nvarchar): table name whit the primary key to which [foreignKeyName] refers to
referencedPkColumns (nvarchar): column names of the the primary key to which [foreignKeyName] refers to
fkCreateStmt (nvarchar): statement to create [foreignKeyName]
fkDropStmt (nvarchar): statement to drop [foreignKeyName]
defaultName (sysname): default constraint name for the current column
defaultValue (nvarchar): default constraint value for the current column
defaultCreateStatement (nvarchar): statement to create default constraint [defaultName]
defaultDropStatement (nvarchar): statement to drop default constraint [defaultName]
checkName (sysname): check constraint name for the current column / table
checkDefinition (nvarchar): definition of check constraint [defaultName]
checkCreateStmt (nvarchar): statement to create check constraint [defaultName]
checkDropStmt (nvarchar): statement to drop check constraint [defaultName]
lindbergh_ddv@hotmail.com (2011)
*/