Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Renaming table Tip

Status
Not open for further replies.

Omono

MIS
Apr 20, 2001
24
US
I have a lot of queries that extract data from a table. I had some problems with a query because the main table is named 'Computer Inventory'. I needed to rename the table to 'Inventory' to solve some problems, but dreaded doing it because of all the queries involved. What I did was to copy the 'Computer Inventory' table into the same database but Saved As 'Inventory'. Then I went into each query, added the newly copied 'Inventory' table, used the drop down box to change the current table name from 'Computer Inventory' to 'Inventory'. Then I removed the old table 'Computer Inventory' from the query and saved it. Of course I ran each query to make sure it still worked. Although this is nothing profound, just tedious, it kept me from having to think up the query criteria again. I hope this helps someone.
 
Yes thats how I do it, however, you can also use an addin like Find and replace ( shareware. absoloutly brilliant little add-in
 
If you look at faq181-2229, there is a function that will capture the SQL for every query and write it to a table. It's then a simple matter to find out which queries are going to be affected if you rename the table.

You can also copy the SQL string into Word, perform a simple search and replace, then copy and paste the SQL string back into your query.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top