Find the non null columns in SQL Server in a table

前端 未结 2 1959
清歌不尽
清歌不尽 2021-01-17 06:03

I have read many answers but they are all for PL/SQL or Oracle, I could not find anything for Microsoft SQL-Server.

My table :

CREATE TABLE StudentSc         


        
2条回答
  •  醉酒成梦
    2021-01-17 06:50

    Perhaps you want to look at INFORMATION_SCHEMA.COLUMNS. The column IS_NULLABLE provides this information.

    Note that the INFORMATION_SCHEMA tables (well, they are really views) are Standard SQL, so this information is available in most database. Oracle has not (yet?) adopted them.

提交回复
热议问题