0

I'm looking for a way to select every valid SQL Server datatypes to load a combobox with that values, but I don't know where I can select it values.

An example for what I want to do is this:

enter image description here

Img Link: http://puu.sh/m4VpV/65bcb8dca6.png

Thanks for your help.

1
  • 2
    You can look at the sys.types view. But be warned it will return ALL the datatypes including those that are deprecated (ie. text) and others that really shouldn't be used (timestamp, sql_variant). There is no automatic way to create nvarchar(32) and nvarchar(max). Commented Dec 22, 2015 at 17:22

1 Answer 1

4

Use SYS.TYPES system view

select name 
from sys.types
where is_user_defined = 0 -- SQL Server system data type.
Sign up to request clarification or add additional context in comments.

1 Comment

Thank you so much, that was what I wanted. :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.