Connecting Tech Pros Worldwide Help | Site Map

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

visu
Guest
 
Posts: n/a
#1: May 8 '07
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

'69 Camaro
Guest
 
Posts: n/a
#2: May 8 '07

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


Hi, Visu.
Quote:
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.visube@gmail.comwrote in message
news:1178602921.934537.40230@e65g2000hsc.googlegro ups.com...
Quote:
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
>

visu
Guest
 
Posts: n/a
#3: May 8 '07

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


On May 8, 12:19 pm, "'69 Camaro" <ForwardZERO_SPAM.To.
69Cam...@Spameater.orgZERO_SPAMwrote:
Quote:
Hi, Visu.
>
Quote:
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:1178602921.934537.40230@e65g2000hsc.googlegro ups.com...
>
>
>
Quote:
Hi ,
>
Quote:
can anyone tell me how to get the complete table schema including
constraints, primary key ..etc.
through sql Query in Ms access.
>
Quote:
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.
>
Quote:
thanks in advance
>
Quote:
Regards
visu- Hide quoted text -
>
- Show quoted text -
thanks .. i ll try with ado.

Regards
Visu

'69 Camaro
Guest
 
Posts: n/a
#4: May 8 '07

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


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.visube@gmail.comwrote in message
news:1178623005.395060.14530@h2g2000hsg.googlegrou ps.com...
Quote:
On May 8, 12:19 pm, "'69 Camaro" <ForwardZERO_SPAM.To.
69Cam...@Spameater.orgZERO_SPAMwrote:
Quote:
>Hi, Visu.
>>
Quote:
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:1178602921.934537.40230@e65g2000hsc.googlegr oups.com...
>>
>>
>>
Quote:
Hi ,
>>
Quote:
can anyone tell me how to get the complete table schema including
constraints, primary key ..etc.
through sql Query in Ms access.
>>
Quote:
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.
>>
Quote:
thanks in advance
>>
Quote:
Regards
visu- Hide quoted text -
>>
>- Show quoted text -
>
thanks .. i ll try with ado.
>
Regards
Visu
>

Closed Thread