SQL server query to get the list of columns in a table along with Data types, NOT NULL, and PRIMARY KEY constraints?
I need to write a query on SQL server to get the list of columns in a particular table, its associated data types and their length and if they are not null. I have managed to do this much. But now i also need to get in the same table against a column - TRUE if it is a primary key. How do i do this ?
This is how the output should be:
`Columns_name----Data type----Length----isnull----Pk`
please help me!