SELECT
column_name
, data_type +
COALESCE(
'(' + CAST(character_maximum_length AS VARCHAR) + ')'
, '(' + CAST(numeric_precision AS VARCHAR) + ')'
, ''
)
, column_default
, is_nullable
FROM
information_schema.columns
WHERE
table_name = 'tablename';
[source]
No comments:
Post a Comment