[thelist] Database Schema from ASP

Joshua Olson joshua at waetech.com
Tue Mar 4 09:11:01 CST 2003

----- Original Message -----
From: "Mike Stenhouse" <Mike.Stenhouse at spiritsoft.com>
Sent: Tuesday, March 04, 2003 9:06 AM

> --
> [ Picked text/plain from multipart/alternative ]
> Does anyone know if it's possible to get the Primary Keys Schema of a
> SQL Server database with ASP?
> I've used myConnection.OpenSchema(someSchema) to get table and column
> schema data but neither have the PK info... I tried OpenSchema(28),
> which ought to get the Primary Keys schema, and all the right fields are
> there (TABLE_NAME, PK_NAME etc) but it's a recordset of 0 records. I do
> definitely have my primary keys defined! Ideally I'd like to retrieve
> the Foreign Key schema (27) as well but that doesn't seem to work either
> despite having my relationships nicely diagrammed.
> Does ADO not support these schemas and if not, is there any other way to
> get them?


Have you looked at the collection of SP's in the master database?  There are
a large number of SP's that can collect and interact with information in the
databases.  Of specific interest in this case may be sp_pkeys.

Usage: sp_pkeys tablename

Likewise, the SP sp_fkeys may be of interest.

Good Luck,


More information about the thelist mailing list