Solved

find columns that cannot be NULL

Posted on 2011-03-02
8
235 Views
Last Modified: 2012-05-11
is there a query that can check which all columns in tables that are designed to be not nullable.

thanks
0
Comment
Question by:anushahanna
[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
  • 3
  • 2
  • 2
  • +1
8 Comments
 
LVL 15

Accepted Solution

by:
cquinn earned 200 total points
ID: 35015771
I don't know how to do it in a query, but the Database documentor tool (on the database tools tab) will show this information
0
 
LVL 4

Assisted Solution

by:MarioAlcaide
MarioAlcaide earned 100 total points
ID: 35015782
I don't think it can be done in Access with a query, it could be done if you use Oracle for example
0
 
LVL 77

Assisted Solution

by:peter57r
peter57r earned 200 total points
ID: 35015842
Can't be done in sql.

You can use a vba function...

Function testreq(tbl As String) As String
Dim reqlist As String
Dim db As Database
Dim tdf As DAO.TableDef
Dim fld As DAO.Field
Set db = CurrentDb
Set tdf = db.TableDefs(tbl)
For Each fld In tdf.Fields
If fld.Required = True Then reqlist = reqlist & fld.Name & ","
Next fld

Set tdf = Nothing
Set db = Nothing
If Len(reqlist) > 1 Then
testreq = Left(reqlist, Len(reqlist) - 1)
Else
testreq = reqlist
End If
End Function

Sub testfn()
MsgBox testreq("products")
End Sub
0
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 
LVL 6

Author Comment

by:anushahanna
ID: 35015868
where can i find the Database documentor tool (in Design?)
0
 
LVL 6

Author Comment

by:anushahanna
ID: 35015869
peter, how can you run the vba as a standalone (like a query) without a click event?
0
 
LVL 77

Assisted Solution

by:peter57r
peter57r earned 200 total points
ID: 35016059
Just change the table name in my testfn() and run that sub.
0
 
LVL 15

Assisted Solution

by:cquinn
cquinn earned 200 total points
ID: 35016190
The database documenter is in the Database Tools tab on the main menu bar
0
 
LVL 6

Author Comment

by:anushahanna
ID: 35150218
thanks all!
0

Featured Post

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

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

In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…

726 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