Charles
Charles

Reputation: 161

Show executed query in Microsoft SQL Server 2016

In MySQL Workbench, after editing a column, table, or whatever, it will show the query for that action.

I could not find a similar feature in SQL Server 2016. I just want to view the SQL for the action I perform, such as editing a column.

Is it possible?

Upvotes: 0

Views: 105

Answers (1)

Bugs
Bugs

Reputation: 4489

Something I've always set is Auto generate change scripts which can be found within the options:

enter image description here

This shows the script and prompts you to save it.

If I don't want it so that every time I do a change it prompts me I use the Generate Change Script icon (first icon below):

enter image description here

This is usually greyed out until you make a modification then you can click it. However the annoying thing is you have to click the icon to generate the script prior to saving the modification.

Downloaded SSMS 2016

The icon has slightly changed. In 2016 this is what you are looking for:

enter image description here

You will want to use the first icon on the toolbar above.

There is also a menu that appears called Table Designer. From there you can also generate the change script. This isn't a new feature in 2016 it was something I noticed when looking for the icon.

Upvotes: 2

Related Questions