question

TatyanaY avatar image
TatyanaY asked

How to set up default advanced scripting options in Generate Scripts wizard?

I wonder if this is possible, and if so how to do this. Like, when you run the Generate Scripts Wizard, "Set Scripting Options" - "Advanced Scripting Options" tab, where do the default settings in the list coming from? Can I set them up to my needs, instead of checking/unchecking them every time? Thank you, - Tatyana
ssmsgenerate-script
1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

GPO avatar image GPO commented ·
+1! Good question!
0 Likes 0 ·
TatyanaY avatar image
TatyanaY answered
Oh, OK, perhaps I did not put my question clear. However, here is the answer: it can be set in the Options // SQL Server Object Explorer // Scripting.
1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Grant Fritchey avatar image Grant Fritchey ♦♦ commented ·
Cool. Glad you figured it out. That's way far off from what I understood we were looking for.
0 Likes 0 ·
Grant Fritchey avatar image
Grant Fritchey answered
Go to the "View" menu in SSMS. Select "Template Explorer". That giant list of T-SQL templates are what's used as a basis for code generation. You can modify those. Unfortunately, there's no easy way to share that with a team.
2 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

TatyanaY avatar image TatyanaY commented ·
Did I understand this correctly, that if I, for example, want "create triggers" option to be checked by default (in the Generate Scripts, Advanced list), I'd need to modify the "Create Table" template to include "Create Trigger" code into it? Then, e.g., the default for "Script Binding" is "false" (I'm using SQL Server 2012 SP2). In, both, "Create Default" and "Create Rule" templates the binding is scripted. Why is it still false?
0 Likes 0 ·
Grant Fritchey avatar image Grant Fritchey ♦♦ commented ·
No. This won't affect the GUI options in any way. These are the scripts that are used when you right click and select "SCRIPT" or use some of the other scripting options within SSMS.
0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.