But it does not seem to work, it throws an exception. I tried to report it but when I clicked Submit Error Report the dialog said:

Quote:

Error Report Rejected:

The error you are trying to report indicates that you are trying to access some database or object for which you do not have the required permissions.

This security error has nothing to do with SQL Assistant.

which is a bit strange, the necessary object were already accessed since the execution plan was shown in SE and the action that failed should only have copied the execution plan xml to clipboard and start SQL Sentry Plan Explorer.

Tue Aug 29, 2017 6:19 am

Mindflux

Joined: 25 May 2013Posts: 645Country: United States

Likewise saving to an XML file doesn't work.

If I save it to xml and try and open it with SQL Plan Explorer it doesn't do anything, but if I right click the plan and do "Show XML" and paste that into SQL Plan Explorer it works.

The text in the saved XML vs "Show XML" in SQL Editor are very different, to top it off.

Tue Aug 29, 2017 9:42 am

Mindflux

Joined: 25 May 2013Posts: 645Country: United States

So "Show XML" then "Open in SE" with the options set to save it to an output file saves a better formed XML file that can be opened by plan explorer via CLI, but invocation from SQL Editor does nothing.

Even though you are copying to the clipboard and then running the program, it still makes the output file and successfully opens it! Without the output file in place, the preferences move the program to execute to the output file which throws an exception.

Also if you don't wrap the program to execute in quotes SQL Editor will tell you "C:\Program" does not exist.

Tue Aug 29, 2017 10:38 am

SysOpSite Admin

Joined: 26 Nov 2006Posts: 6642

I think "Program to Run" isn't a good name for that option. It's better be called "Command Line" as it may include command line parameters. You're responsible for the parameters and correct syntax. If the path or parameters include spaces, they should be enclosed in double quotes.

Tue Aug 29, 2017 11:18 am

Mindflux

Joined: 25 May 2013Posts: 645Country: United States

SysOp wrote:

I think "Program to Run" isn't a good name for that option. It's better be called "Command Line" as it may include command line parameters. You're responsible for the parameters and correct syntax. If the path or parameters include spaces, they should be enclosed in double quotes.

There are still bugs/idiosyncrasies with it though... the examples given above make it difficult to use because things save to the wrong spot or don't necessarily work.

For example. If I set it to save to output file and run program

and set my program to run to "C:\Program Files\SQL Sentry\SQL Sentry Plan Explorer\SQL Sentry Plan Explorer.exe" C:\temp\outputfile.xml

It doesn't launch the program, period.

The only way I got it to work is to "trick" it by telling it to copy contents to the clipboard, then I still had to set an output file (to avoid the program path being moved to the output file). Then to top THAT off, I did NOT have to specify the target file for SQL Sentry Plan Explorer to open in the "Command to run" like my above example, I simply told it what program to run with no parameters and SQL Editor must have told it to open my C:\temp\outputfile.xml itself.

Tue Aug 29, 2017 11:25 am

SysOpSite Admin

Joined: 26 Nov 2006Posts: 6642

Thank you. I will certainly pass your input to the team and ask them to fix whatever is necessary to fix to make it work well.

Tue Aug 29, 2017 11:42 am

Mindflux

Joined: 25 May 2013Posts: 645Country: United States

I did find this in the SQLAssistant.log that is likely related to gemisigo's post:

This happens when you leave output file blank, but set the program to run. When you save it and exit the SQL Assistant settings dialog, it seems to save the program to run as the output file (like seen in one of my posts above)... so when gemisigo tries to run his custom menu item it's trying to output the plan and overwrite the targeted executable.

Tue Aug 29, 2017 11:59 am

gemisigo

Joined: 11 Mar 2010Posts: 1441

Yes, this must be how it happened. At first I wasn't sure what you were talking about because simply applying changes puts everything where they belong. I almost never close SA Options, I just apply changes and let that window rest in the background since I use it pretty frequently. But now I repeated the steps as described (using OK instead of Apply) and it had the contents of External Program moved to Output File.

You might also take a look at that xml thing. Having the format set to XML still throws exception. I had to set it to Default so that SA could open SSPE but then the saved xml was not a valid execution plan desrciption, thus SSPE failed to load it. When I set the pane to show XML, I've seen this:

and the saved file content was:

I'm sorry for the images but it seems that putting xml into a reply (regardless of being in code/quote) will remove much of the contents when displaying the post.

Tue Aug 29, 2017 1:14 pm

Mindflux

Joined: 25 May 2013Posts: 645Country: United States

Yes you have to set the format to default rather than XML

Also I told my menu to pop up on all menues because to get the right XML you need to right click show xml on the query plan and then open it with SPE (right click menu) otherwise you get a malformed xml plan.