Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- select column_type = data_type +
- case
- when data_type like '%text' then ''
- when data_type like '%char' and character_maximum_length = -1 then '(max)'
- when character_maximum_length is not null then '(' + convert(varchar(10), character_maximum_length) + ')'
- when data_type = 'numeric' then '(' + convert(varchar(10), isnull(numeric_precision, 18)) + ', ' +
- convert(varchar(10), isnull(numeric_scale, 0)) + ')'
- else ''
- end
- ,*
- from information_schema.columns
Add Comment
Please, Sign In to add comment