Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Identify a column is NULLABLE or not throughout the DB

Posted on 2013-06-07
2
Medium Priority
?
251 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 2000 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you having speed problem in loading SQL Server Management Studio, try to uncheck these options in your internet browser (IE -> Internet Options / Advanced / Security):    . Check for publisher's certificate revocation    . Check for server ce…
I am showing a way to read/import the excel data in table using SQL server 2005... Suppose there is an Excel file "Book1" at location "C:\temp" with column "First Name" and "Last Name". Now to import this Excel data into the table, we will use…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…

609 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