The Script as
option (available in right click menu on any object in Object Explorer
) in SSMS is really handy to script out objects for alter, create and select and several other operations.
I use it often. But I see it does not let me script out multiple objects (say multiple tables) at once. Holding down the Ctrl
or Shift
key does not let me select multiple objects. Recently I needed to compare schema for 3-4 tables across different QA environments, so I had to script out the tables one table at a time and repeat it in all QA environments.
Is there way from SSMS to script out multiple objects at once? Selecting one object at a time and scripting it out is irritating.
This can be done exactly as requested by:
1) Menu: View -> Object Explorer Detail (F7)
2) Click on "Tables" folder in the Explorer tree and the tables will show in the Object Explorer Detail.
3) Select in the Object Explorer Detail tables you need and then as usually "Script table as..." --> CREATE TO --> New Query Window (or whatever you prefer).
Unfortunately, this works for CREATE TO and DROP and such, but not for SELECT, INSERT TO, etc.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With