Toad World® Forums

Can't open tsm file


I created alot of tsm files in a project that have worked fine. Now all the sudden I am getting an error code that says only sql can be recovered but the query is empty. I also tried reverse engineering using the editor but all the files appear empty. This is the error that comes up:
Unexpected end of file while parsing Name has occurred. Line 64, position 883.
Stack Trace:
at System.Xml.XmlTextReaderImpl.Throw(Exception e)
at System.Xml.XmlTextReaderImpl.Throw(String res, String arg)
at System.Xml.XmlTextReaderImpl.Throw(Int32 pos, String res, String arg)
at System.Xml.XmlTextReaderImpl.ParseQName(Boolean isQName, Int32 startOffset, Int32& colonPos)
at System.Xml.XmlTextReaderImpl.ThrowTagMismatch(NodeData startTag)
at System.Xml.XmlTextReaderImpl.ParseEndElement()
at System.Xml.XmlTextReaderImpl.ParseElementContent()
at System.Xml.XmlTextReaderImpl.Read()
at System.Xml.XmlLoader.LoadNode(Boolean skipOverWhitespace)
at System.Xml.XmlLoader.LoadDocSequence(XmlDocument parentDoc)
at System.Xml.XmlLoader.Load(XmlDocument doc, XmlReader reader, Boolean preserveWhitespace)
at System.Xml.XmlDocument.Load(XmlReader reader)
at System.Xml.XmlDocument.LoadXml(String xml)
at System.Xml.XmlDocument.set_InnerXml(String value)
at Quest.Toad.QueryBuilder.QueryBuilderControl.LoadDocument(String xml)
at Quest.Toad.QueryBuilder.QueryBuilderControl.SetXml(String xml)
at Quest.Toad.QueryBuilder.QueryBuilderControl.set_Xml(String value)
at Quest.Toad.QueryBuilder.QueryBuilder.LoadModel(String file, String xml)
at Quest.Toad.QueryBuilder.QueryBuilder.OpenFile(String file)
at Quest.Toad.QueryBuilder.QueryBuilder.timerDelayFileLoad_Tick(Object sender, EventArgs e)
at System.Windows.Forms.Timer.OnTick(EventArgs e)
at System.Windows.Forms.Timer.TimerNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

All but one of 60 files is behaving the same way. Any assistance would be greatly appreciated.
Old_Demo_50state_1.tsm (5.27 KB)


We are taking a look at the file. We will let you know the result of our investigation.



Is it possible that someone tried to edit these files manually? We found that everywhere there was the keyword “select” the context was messed up.

Selectector xpath --> should be selector xpath
SelectECT --> should be Select
StatementType=“Selectect” --> should be StatementType=“Select”

In addition, becuase of these changes the byte mark which includes the size of the file is wrong.

I have attached a revised file that loads for me. I cannot tell if all is corrected as I do not have the objects in the file.

Old_Demo_50state_1R.tsm (5.6 KB)


Yes that is the correct script. No on the edit files manually. While working in toad on a totally different file none of these even being opened we had a dropped network drive issue and my computer locked up. Had to perform a hard shut down and when the computer had rebooted I got this error on every file I had created in my project folder only. Files saved that were not included in the project folder are fine. Is there a way for me to fix all these files so that I don’t have to recreate from scratch?


Also I was using version 2.5. After updating to version 2.7 some of the files are working. It appears that in project manager the damaged files are indented to the right *_1.tsm - _tesdataroll.tsm. It much better but now I’m afraid to continue using Project Manager. Any suggestions for preventing this in the future?

Message was edited by: JanineO

Message was edited by: JanineO


Error screen shot


Since these files were on a network drive, is it possible that someone else uses these files also? Or if the drive failed, perhaps something happened when copying the files from backup to the new drive.

On fixing the files, open up one and see if the three items that I showed are also corrupt. If so, change then and then also delete byte mark at the top fo the file. The byte mark can be seen using simple xml edtiors such as Foxe.exe which you can download. If the error is consistant then the files can be fixed manaually.

I’ve never seen the issue you mention on the project manager. But I do not think the project manager has anything to do with the file corruption.



Thank you for all your help very much appreciated.