Showing posts with label mssms. Show all posts
Showing posts with label mssms. Show all posts

Wednesday, March 28, 2012

MSSMS templates when creating procs from Object Explorer -vs- Solution Explorer

I'm trying to integrate SSMS into our small IT shop. Having the templates available in MSSMS will help enforce standards.

My question is why can I right click on the stored proc folder in Object Explorer and get the nice template withthe replaceable params but when I right click in the Queries folder of Solution Explorer I only get a blank query window? It seems to me that I should have templates available in SE too.

I add a new (blank) query into the solution, then right-click/copy the appropriate template from the Template Explorer. This can then be pasted into the new query window.

But you're correct, it would be much nicer to be able to "add from template" straight into the solution.

Jamie

|||Thats a great suggestion can you file it on http://connect.microsoft.com?

MSSMS 05 generates all stored procedures as dynamic sql

Hi,
For some odd reason my MSSMS05 has started generating all stored
procedure scripts as dynamic sql. I cannot seem to find any options
under options-->scripting that seem related to this.
To clarify, when right-clicking a stored procedure and selecting
'modify' or any of the options under 'Script stored procedure as', the
output is wrapped as a dynamic sql statement, wrapped in exec
sp_executesql statements.
What option have I foolishly turned on, and where can I turn it off
again?
best regards,
Henrik
Try the "Include IF NOT EXISTS clause" option under Tools | Options /
Scripting. Since this requires an IF block, and you can't have a GO inside
of this, you need to use dynamic SQL.
"Henrik" <nielsen.henrik@.gmail.com> wrote in message
news:185b136f-b493-4047-bb95-e96b44713c2c@.j44g2000hsj.googlegroups.com...
> Hi,
> For some odd reason my MSSMS05 has started generating all stored
> procedure scripts as dynamic sql. I cannot seem to find any options
> under options-->scripting that seem related to this.
> To clarify, when right-clicking a stored procedure and selecting
> 'modify' or any of the options under 'Script stored procedure as', the
> output is wrapped as a dynamic sql statement, wrapped in exec
> sp_executesql statements.
> What option have I foolishly turned on, and where can I turn it off
> again?
> best regards,
> Henrik
|||That did it, thank you very much Aaron!
On Dec 4, 1:18 pm, "Aaron Bertrand [SQL Server MVP]"
<ten...@.dnartreb.noraa> wrote:[vbcol=seagreen]
> Try the "Include IF NOT EXISTS clause" option under Tools | Options /
> Scripting. Since this requires an IF block, and you can't have a GO inside
> of this, you need to use dynamic SQL.
> "Henrik" <nielsen.hen...@.gmail.com> wrote in message
> news:185b136f-b493-4047-bb95-e96b44713c2c@.j44g2000hsj.googlegroups.com...
>
>
sql