Solved

Identify a column is NULLABLE or not throughout the DB

Posted on 2013-06-07
2
231 Views
Last Modified: 2013-06-07
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
Comment
Question by:Easwaran Paramasivam
2 Comments
 
LVL 8

Expert Comment

by:didnthaveaname
ID: 39228781
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
 
LVL 7

Accepted Solution

by:
Ross Turner earned 500 total points
ID: 39228813
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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
get all customers 2 39
Stored procedure query with if 27 32
sql Audit table 3 48
SQL Restore Script - Syntax Error 8 75
INTRODUCTION: While tying your database objects into builds and your enterprise source control system takes a third-party product (like Visual Studio Database Edition or Red-Gate's SQL Source Control), you can achieve some protection using a sing…
In this article I will describe the Copy Database Wizard method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now