test

0

Please login or register to vote for this query.

(click on this box to dismiss)

Academia Meta

Q&A about the site for academics and those enrolled in higher education

SELECT
  table_name,
  ordinal_position,
  column_name,
  CASE
    WHEN data_type like '%varchar%'
      THEN data_type+'('+cast(character_maximum_length as varchar)+')'
    WHEN data_type like '%int%'
      THEN data_type+'('+cast(numeric_precision as varchar)+')'
    ELSE
      data_type
  END AS [type]
FROM information_schema.columns
ORDER BY table_name, ordinal_position

Enter Parameters

Options:
Switch to main site
loading Hold tight while we fetch your results