5

Is there a list what datatype corresponds to the system_type_id in Sys.columns. I am looking for an easy way to examine the columns we have in the database and i would like to avoid the INFORMATION_SCHEMA.COLUMNS.

15

Yes you can look in sys.types for such a list or use the type_name function to look up an individual type_id.

| improve this answer | |
  • 1
    Definitely easier than my post. But not quite as fun :) Thank you though. – James Rhoat Apr 26 '16 at 22:17
0

system_type_id is not unique in sys.types because user types can reuse system type. To get a list of unique system types, you can select rows where system_type_id = user_type_id. They equal only for system types.

SELECT system_type_id, name
FROM sys.types
WHERE system_type_id = user_type_id
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.