I have created a cross-connection query between two sql servers. When I save the file (as a .sql) and re-open it, it is back in a standard editor, not a cross-connection editor and therefore errors out when attempting to run. I can’t figure out how to switch this existing editor back to cross-connection mode or how to save it so it opens as a cross-connection query n its own. On TDP 4.3.
It should open as Cross-Connection SQL Editer. It scans the SQL and determines that the tables are using connection names as part of a three part identifier. Example below. So for some reason this parsing is failing. Do you have comments or something at the top of your SQL? Or is the file from someone else and you do not have the connections used named the same way?
If not please post your From clause so I can see.
ON (REGION.REGION_ID = address.REGION_ID)
So for some reason this parsing is failing. Do you have comments or something at the top of your SQL? Or is the file from someone else and you do not have the connections used named the same way? Thanks and Regards, https://get3dsemulator.org/ https://get-cartoonhd.org/
Yes, I have comments at the top. I’ll try deleting them and see is that works, but that is a huge pain since we use headers on all our scripts.
Please confirm that is the issue and then we can see about ignoring the comments at the top.
Looks like if there are any sql server single line comments ("- -" syntax) anywhere in the file, TOAD wont recognize it as a cross-connection query. Multi-line comment sytax ("/* */") appear to be OK.
Sounds like a parsing error. We parse the file to figure out if it is XQuery or not. Can you live with the old style comments?