Discussion:
Extracting view (queries) definitions
(too old to reply)
Eric Caron
2008-05-13 15:46:35 UTC
Permalink
Hi everyone,

I don't know if this is the right newsgroup for this kind of question, but
here goes: Is there a way to extract the SQL definition of the queries in
an access database? When I try to import the data in a new SQL Server
database, the views are imported as tables, which is clearly not what I
want.

I decided to do some research to see if I can extract the DDL from the
queries and re-create the views that way, but since Access does not support
something like INFORMATION_SCHEMA.VIEWS, I've been banging my head on the
wall for a while now. Is there an equivalent way to extract the metadata?

Any help and/or suggestions very much appreciated.

Eric.
Eric Caron
2008-05-13 16:42:04 UTC
Permalink
Found the answer to my own question:

After doing some more research, I found another method on the
OleDbConnection object called GetOleDbSchemaTable which returns the view
definition as one of the columns. Why have two methods (GetSchema and
GetOleDbSchemaTable) which return some of the same information, I don't
know, but I can finally extract the data I need.

Hope this can help someone else!

Eric.
Post by Eric Caron
Hi everyone,
I don't know if this is the right newsgroup for this kind of question, but
here goes: Is there a way to extract the SQL definition of the queries in
an access database? When I try to import the data in a new SQL Server
database, the views are imported as tables, which is clearly not what I
want.
I decided to do some research to see if I can extract the DDL from the
queries and re-create the views that way, but since Access does not
support something like INFORMATION_SCHEMA.VIEWS, I've been banging my head
on the wall for a while now. Is there an equivalent way to extract the
metadata?
Any help and/or suggestions very much appreciated.
Eric.
Loading...