Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Auto Connect to current server after Script as... #825

Closed
barryseymour opened this issue Mar 2, 2018 · 7 comments · Fixed by #2123
Closed

Feature Request: Auto Connect to current server after Script as... #825

barryseymour opened this issue Mar 2, 2018 · 7 comments · Fixed by #2123
Assignees
Labels

Comments

@barryseymour
Copy link

  • SQL Operations Studio Version: 0.26.7

When scripting an object, opening a script from file or creating a new script, I'd like it if SQLOps automatically connected to the current server.

Steps to Reproduce:
#1: Altering a stored procedure
Open Servers
Locate a stored procedure
Right-click, select 'Script as Alter'
Run Script - CONNECTION appears.
Would prefer if it assumed the same connection you opened it from.

#2. Opening a File or creating a new script
Open or create a script
Modify as needed
Press F5 to run - CONNECTION appears
Would prefer if it assumed the current connection.

@anthonydresser
Copy link
Contributor

I believe this is intended behavior and this is actually a regression.

@barryseymour
Copy link
Author

Intended behavior? Adding extra steps? Can't get behind that decision.

@anthonydresser
Copy link
Contributor

anthonydresser commented Mar 29, 2018

I mean that it should be auto connecting, and the behavior that it is not, is a bug

@barryseymour
Copy link
Author

barryseymour commented Mar 29, 2018

Ah. "This is the intended behavior." Yes, then we are on the same page.

@kburtram
Copy link
Member

The current behavior is "by design" though I agree the design is currently incorrect.

Initially we only supported Script as Create scenario throught the Go to Definition command. The problem with auto-connecting when generating a create statement is that the entire statement will be highlighted as a syntax error as a duplicate database object. In the Go to Definition scenario having the CREATE highlighted with the red squiggly seemed undesirable.

In the Script as Alter, Script as Execute, etc. the editor certainly should be connected. We're currently thinking we'll update the behavior to connect for any scripting operation other than Script as Create. I guess we could further refine this to only not connect in Go to Definition scripting and have the explicit Script as Create command connect assuming the typical scenario is to alter the CREATE statement and execute it on the current connection.

@kburtram kburtram added this to the June "GA" Release milestone Apr 12, 2018
@barryseymour
Copy link
Author

If you generate a CREATE script, could you not preface with a DROP [objecttype] IF EXISTS [objectname]? That would prevent the syntax error notification.

@kburtram
Copy link
Member

@barryseymour that's a good suggestion, thought I'm not sure we would want to add a drop statement into the Script as Create to avoid any user confusion or accidents. SSMS has a separate Script Drop and Create which we could also consider. I'll discuss a bit with our PM and try to figure out what makes the most sense here. Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants