• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 252
  • Last Modified:

Identify a column is NULLABLE or not throughout the DB

In my DB 'CreatedDtm' column is present in all the tables. I would like to know in all the tables the column is NOT NULLABLE. How to ensure that without scanning each table by table using TSQL?


Please do assist.
0
Easwaran Paramasivam
Asked:
Easwaran Paramasivam
1 Solution
 
didnthaveanameCommented:
Should be able to accomplish this with a join of sys.columns (http://msdn.microsoft.com/en-us/library/ms176106.aspx) and sys.tables (http://msdn.microsoft.com/en-us/library/ms187406.aspx)
0
 
Ross TurnerCommented:
Try This:

select st.name,sc.name,sc.is_nullable from sys.columns sc
inner join sys.tables st on sc.object_id = st.object_id
where sc.name like 'CreatedDtm'

Open in new window

0

Featured Post

Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

Tackle projects and never again get stuck behind a technical roadblock.
Join Now