HELP !!! - export query tool??

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Does anybody know of any tool out there where I can export the SQL of all my
queries?

Right now, I have 250 queries and have to open each one, switch to view SQL
and then copy and paste.

HELP!!!
 
This is the basic idea for looping through your queries:

Dim db As DAO.Database
Dim qdf As DAO.QueryDef

Set db = CurrentDb()
For Each qdf in db.QueryDefs
Debug.print qdf.Name, qdf.SQL
Next

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

"MSSQLServerDeveloper" <[email protected]>
wrote in message
news:[email protected]...
 
1. Tools | Analyze | Documentor

2. Click on the Queries tab

3. Click the "Select All" button to select all the queries

4. Click the "Options" button

5. In the "Include for Query" area only check the box for SQL
In the "Include for Fields" area select Nothing
In the "Include for Indexes" area select Nothing

6. Hit OK on this dialog box

7. Hit OK on the main Documentor form

8. A report will be prepared that shows the SQL for each query.
 
Once this is done per Jeff's steps, you can query the documenter information
by linking to the doc_tblObjects table in the wizard mdt file. On my
workstation, this file is C:\Documents and Settings\hookomd\Application
Data\Microsoft\Access\ACWZUSRT.MDT.

Once you link to this table, create a query with this sql:
SELECT doc_tblObjects.Name, doc_tblObjects_1.Extra1 AS [SQL]
FROM doc_tblObjects AS doc_tblObjects_1
INNER JOIN doc_tblObjects ON doc_tblObjects_1.ParentID =
doc_tblObjects.ID
WHERE doc_tblObjects_1.Name="SQL";

This will result in a datasheet of two columns: query name and query sql.
 
Good information Duane.
Although the Documentor can spit out a TON of information,
I've never found it to be "paper friendly" at all. On this
particular occasion I have an entire page for each query SQL
output! Good grief!

Maybe I should make an Add-In to do this and generate
a much better report. Humm......

--
Jeff Conrad
Access Junkie
Bend, Oregon

Duane Hookom said:
Once this is done per Jeff's steps, you can query the documenter information
by linking to the doc_tblObjects table in the wizard mdt file. On my
workstation, this file is C:\Documents and Settings\hookomd\Application
Data\Microsoft\Access\ACWZUSRT.MDT.

Once you link to this table, create a query with this sql:
SELECT doc_tblObjects.Name, doc_tblObjects_1.Extra1 AS [SQL]
FROM doc_tblObjects AS doc_tblObjects_1
INNER JOIN doc_tblObjects ON doc_tblObjects_1.ParentID =
doc_tblObjects.ID
WHERE doc_tblObjects_1.Name="SQL";

This will result in a datasheet of two columns: query name and query sql.

--
Duane Hookom
MS Access MVP
--

Jeff Conrad said:
1. Tools | Analyze | Documentor

2. Click on the Queries tab

3. Click the "Select All" button to select all the queries

4. Click the "Options" button

5. In the "Include for Query" area only check the box for SQL
In the "Include for Fields" area select Nothing
In the "Include for Indexes" area select Nothing

6. Hit OK on this dialog box

7. Hit OK on the main Documentor form

8. A report will be prepared that shows the SQL for each query.

--
Jeff Conrad
Access Junkie
Bend, Oregon

"MSSQLServerDeveloper" <[email protected]>
wrote in message
 
Everybody - Thanks very much for the help. I got it

Duane Hookom said:
Once this is done per Jeff's steps, you can query the documenter information
by linking to the doc_tblObjects table in the wizard mdt file. On my
workstation, this file is C:\Documents and Settings\hookomd\Application
Data\Microsoft\Access\ACWZUSRT.MDT.

Once you link to this table, create a query with this sql:
SELECT doc_tblObjects.Name, doc_tblObjects_1.Extra1 AS [SQL]
FROM doc_tblObjects AS doc_tblObjects_1
INNER JOIN doc_tblObjects ON doc_tblObjects_1.ParentID =
doc_tblObjects.ID
WHERE doc_tblObjects_1.Name="SQL";

This will result in a datasheet of two columns: query name and query sql.

--
Duane Hookom
MS Access MVP
--

Jeff Conrad said:
1. Tools | Analyze | Documentor

2. Click on the Queries tab

3. Click the "Select All" button to select all the queries

4. Click the "Options" button

5. In the "Include for Query" area only check the box for SQL
In the "Include for Fields" area select Nothing
In the "Include for Indexes" area select Nothing

6. Hit OK on this dialog box

7. Hit OK on the main Documentor form

8. A report will be prepared that shows the SQL for each query.

--
Jeff Conrad
Access Junkie
Bend, Oregon

"MSSQLServerDeveloper" <[email protected]>
wrote in message
 
Back
Top