# TSM data base change

**URL:** <https://forums.toadworld.com/t/tsm-data-base-change/6253>\
**Category:** Toad Data Point & Toad Intelligence Central\
**Created:** [July 10, 2010, 6:36pm UTC](https://forums.toadworld.com/t/tsm-data-base-change/6253 "2010-07-10T18:36:34Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![jim.mccann\_718](https://avatars.discourse-cdn.com/v4/letter/j/3d9bf3/32.png) [@jim.mccann\_718](https://forums.toadworld.com/u/jim.mccann_718)\
**Post date:** [July 10, 2010, 6:36pm UTC](https://forums.toadworld.com/t/tsm-data-base-change/6253/1 "2010-07-10T18:36:34Z")

</div>

I recently created a new tsm file using a test db

I would like to reuse it and point to my production db

I can not find a simple solution in TOAD and hope that someone can point me in the right direction.

Thanks

---

<div class="post-metadata">

**Author:** ![Debbie\_Peabody](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/debbie_peabody/32/18_2.png) [@Debbie\_Peabody](https://forums.toadworld.com/u/Debbie_Peabody)\
**Post date:** [July 10, 2010, 7:42pm UTC](https://forums.toadworld.com/t/tsm-data-base-change/6253/2 "2010-07-10T19:42:09Z")

</div>

Currently the Query Builder wants to use the connection it is saved with. I entered CR 75,799 to allow executing against different connections.

For now, try this work around.

1. Open tsm file.
2. Press the ‘Send to Editor’ button. This will send the SQL to a new editor.
3. Change the current connection to the one you want. (Use the drop down on the BOTTOM RIGHT of application)
4. Press the ‘Send to Query Builder’ button. This will reserve engineer this SQL into a new Query Builder that is pointing to the connection you want.
5. Save to new tsm file.

In the end you are making another file with the new connection, but should be workable for what you need.

Debbie

---

<div class="post-metadata">

**Author:** ![jim.mccann\_718](https://avatars.discourse-cdn.com/v4/letter/j/3d9bf3/32.png) [@jim.mccann\_718](https://forums.toadworld.com/u/jim.mccann_718)\
**Post date:** [July 10, 2010, 9:04pm UTC](https://forums.toadworld.com/t/tsm-data-base-change/6253/3 "2010-07-10T21:04:03Z")

</div>

Thanks  
That is what I am doing and hoped there was a 1 step approach.  
The one thing I need to do still is replace the old db name with the new.

---

<div class="post-metadata">

**Author:** ![Debbie\_Peabody](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/debbie_peabody/32/18_2.png) [@Debbie\_Peabody](https://forums.toadworld.com/u/Debbie_Peabody)\
**Post date:** [July 10, 2010, 11:43pm UTC](https://forums.toadworld.com/t/tsm-data-base-change/6253/4 "2010-07-10T23:43:39Z")

</div>

You also use the Find and Replace in files to change the connect data.

---

<div class="post-metadata">

**Author:** ![jim.mccann\_718](https://avatars.discourse-cdn.com/v4/letter/j/3d9bf3/32.png) [@jim.mccann\_718](https://forums.toadworld.com/u/jim.mccann_718)\
**Post date:** [July 11, 2010, 7:19am UTC](https://forums.toadworld.com/t/tsm-data-base-change/6253/5 "2010-07-11T07:19:46Z")

</div>

Thanks again

I have done all that and edited the query via the diagram where I added a new table and column. Saved the file as a .sql all looked good.

Except when I open the sql file I get nothing like the sql statement I left in there. There is all this formatting going on in the file what perhaps looks like the formatting for the diagram.

No sign of sql code and it will not run.

More advice is appreciated.

Jim

---

<div class="post-metadata">

**Author:** ![Debbie\_Peabody](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/debbie_peabody/32/18_2.png) [@Debbie\_Peabody](https://forums.toadworld.com/u/Debbie_Peabody)\
**Post date:** [July 11, 2010, 6:26pm UTC](https://forums.toadworld.com/t/tsm-data-base-change/6253/6 "2010-07-11T18:26:39Z")

</div>

I assume you mean you saved to a tsm file (not .sql). When you changed the connection and sent to a new Query Builder you should see the diagram built. If the scope of the new connection was different and the tables don’t resolve you will get a message that says the Query Builder could not reverse engineer it. I’ll assume the tables exist on both databases. Check the schema. If the tables are not schema referenced and your connection does not alter to that schema the tables will not resolve. Check and see if this is the case.

Debbie  
P.S. Did you execute the sql in the editor after you changed the connection?
