473,399 Members | 2,159 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

how to get the complete table schema including constraints thru SQL query

Hi ,

can anyone tell me how to get the complete table schema including
constraints, primary key ..etc.
through sql Query in Ms access.

We can get table information in MS SQL Server by means using sp_help.I
want to know the equivalent sql command for ms-access.

thanks in advance

Regards
visu

May 8 '07 #1
3 31546
Hi, Visu.
We can get table information in MS SQL Server by means using sp_help.I
want to know the equivalent sql command for ms-access.
SQL Server has system tables that contain information on each table's
structure. Access does not. Therefore, there are no system tables to query
with Jet SQL. Use the ADO and ADOX libraries, or the DAO library in VBA
instead. Use Tables and Indexes if using ADOX. Use TableDefs, Fields, and
the PrimaryKey Index if using DAO. One must use ADO's OpenSchema function
of the Connection object to retrieve the list of constraints, not DAO,
because it's not available in DAO.

If you just want the column names of a table, that's easy enough with SQL.
Try the following syntax to export the column names to a text file:

SELECT * INTO [TEXT;HDR=Yes;DATABASE=F:\Work\Test\].MyTable.txt
FROM MyTable
WHERE (1 = 0);

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips and tutorials.
Blogs: www.DataDevilDog.BlogSpot.com, www.DatabaseTips.BlogSpot.com
http://www.Access.QBuilt.com/html/ex...ributors2.html for contact
info.
"visu" <k.******@gmail.comwrote in message
news:11*********************@e65g2000hsc.googlegro ups.com...
Hi ,

can anyone tell me how to get the complete table schema including
constraints, primary key ..etc.
through sql Query in Ms access.

We can get table information in MS SQL Server by means using sp_help.I
want to know the equivalent sql command for ms-access.

thanks in advance

Regards
visu

May 8 '07 #2
On May 8, 12:19 pm, "'69 Camaro" <ForwardZERO_SPAM.To.
69Cam...@Spameater.orgZERO_SPAMwrote:
Hi, Visu.
We can get table information in MS SQL Server by means using sp_help.I
want to know the equivalent sql command for ms-access.

SQL Server has system tables that contain information on each table's
structure. Access does not. Therefore, there are no system tables to query
with Jet SQL. Use the ADO and ADOX libraries, or the DAO library in VBA
instead. Use Tables and Indexes if using ADOX. Use TableDefs, Fields, and
the PrimaryKey Index if using DAO. One must use ADO's OpenSchema function
of the Connection object to retrieve the list of constraints, not DAO,
because it's not available in DAO.

If you just want the column names of a table, that's easy enough with SQL.
Try the following syntax to export the column names to a text file:

SELECT * INTO [TEXT;HDR=Yes;DATABASE=F:\Work\Test\].MyTable.txt
FROM MyTable
WHERE (1 = 0);

HTH.
Gunny

Seehttp://www.QBuilt.comfor all your database needs.
Seehttp://www.Access.QBuilt.comfor Microsoft Access tips and tutorials.
Blogs:http://www.DataDevilDog.BlogSpot.com...utors2.htmlfor contact
info.

"visu" <k.vis...@gmail.comwrote in message

news:11*********************@e65g2000hsc.googlegro ups.com...
Hi ,
can anyone tell me how to get the complete table schema including
constraints, primary key ..etc.
through sql Query in Ms access.
We can get table information in MS SQL Server by means using sp_help.I
want to know the equivalent sql command for ms-access.
thanks in advance
Regards
visu- Hide quoted text -

- Show quoted text -
thanks .. i ll try with ado.

Regards
Visu

May 8 '07 #3
You're welcome. Good luck with it.

Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips and tutorials.
Blogs: www.DataDevilDog.BlogSpot.com, www.DatabaseTips.BlogSpot.com
http://www.Access.QBuilt.com/html/ex...ributors2.html for contact
info.
"visu" <k.******@gmail.comwrote in message
news:11*********************@h2g2000hsg.googlegrou ps.com...
On May 8, 12:19 pm, "'69 Camaro" <ForwardZERO_SPAM.To.
69Cam...@Spameater.orgZERO_SPAMwrote:
>Hi, Visu.
We can get table information in MS SQL Server by means using sp_help.I
want to know the equivalent sql command for ms-access.

SQL Server has system tables that contain information on each table's
structure. Access does not. Therefore, there are no system tables to
query
with Jet SQL. Use the ADO and ADOX libraries, or the DAO library in VBA
instead. Use Tables and Indexes if using ADOX. Use TableDefs, Fields,
and
the PrimaryKey Index if using DAO. One must use ADO's OpenSchema
function
of the Connection object to retrieve the list of constraints, not DAO,
because it's not available in DAO.

If you just want the column names of a table, that's easy enough with
SQL.
Try the following syntax to export the column names to a text file:

SELECT * INTO [TEXT;HDR=Yes;DATABASE=F:\Work\Test\].MyTable.txt
FROM MyTable
WHERE (1 = 0);

HTH.
Gunny

Seehttp://www.QBuilt.comfor all your database needs.
Seehttp://www.Access.QBuilt.comfor Microsoft Access tips and tutorials.
Blogs:http://www.DataDevilDog.BlogSpot.com...utors2.htmlfor
contact
info.

"visu" <k.vis...@gmail.comwrote in message

news:11*********************@e65g2000hsc.googlegr oups.com...
Hi ,
can anyone tell me how to get the complete table schema including
constraints, primary key ..etc.
through sql Query in Ms access.
We can get table information in MS SQL Server by means using sp_help.I
want to know the equivalent sql command for ms-access.
thanks in advance
Regards
visu- Hide quoted text -

- Show quoted text -

thanks .. i ll try with ado.

Regards
Visu

May 8 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: So Hok Chun, Bill | last post by:
Dear all, I am new to SQL programming. I'd like to know what are the usual practices in documenting the table schema. How to document relationship among tables? (by diagram or text...
2
by: Sgt. Sausage | last post by:
Quick question: Does SQL do table/schema changes "in place"? I've got a large table (140+ million rows of very wide data) that we want to change the schema on -- basically to remove a number...
2
by: Ajit | last post by:
Hi, My stored procedure was working fine but when i made added 2 fields to my table and then made subsequent changes to my sp it give me the following error: "Could not complete cursor...
0
by: Domenico Briganti | last post by:
Hello! Exist a tool for create a windows form for insert/modify/delete row in a table from a table schema? Thank Domenico
1
by: gaozj111 | last post by:
Hello: Now i want to rename the table schema for example: there is one table ,whose name is A.TEST,the A is the schema name, now i want to rename the A TO B. I want to get the B.TEST table.
13
by: N. Graves | last post by:
Thanks for taking time to read my questions. I'm looking for a way in Access that I could run a query that would return table schema information. Specifically I need to get the column name,...
22
by: klenwell | last post by:
I'm in the process of refactoring the php code base I've amassed over the last few years into an object-oriented framework. I'm about to start in on the authentication/login extension and I've...
13
by: amit2781 | last post by:
How can we get the table schema information in MYSQL 5.1.34? Like we use in ORACLE to get it as: OCIDescribeAny() // //get the describe handle for the table to be described. OCIAttrGet() ...
5
by: tasawer | last post by:
I need some assistance with SQL query. I will be grateful if you can provide help please. I have a database that records details of a road traffic accident and name of driver. sub-form records...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.