August 21, 2018 at 11:03 am
Luis Cazares - Wednesday, April 6, 2016 11:36 PMComments posted to this topic are about the item Using Code Snippets in SSMS
Wow, followed all the steps, I think. but SSMS doesn't see my custom snippets.
April 11, 2020 at 2:42 pm
Hi
Anyway to create a surround snippet for a SQL function like SUM(), CONVERT(), ISNULL() with AS Field at the end
SUM(MyField) AS MyField ?
It is not possible to include $selected$ twice in a snippet code as in:
Code Language="SQL"><![CDATA[SUM($selected) AS $selected$]]>
Do you know another way ?
I tried many SSMS addons. None is able to do this 🙁
April 11, 2020 at 3:19 pm
This is great article! I'm going to give it a try.
Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können
April 13, 2020 at 4:28 pm
Hi
Anyway to create a surround snippet for a SQL function like SUM(), CONVERT(), ISNULL() with AS Field at the end
SUM(MyField) AS MyField ?
It is not possible to include $selected$ twice in a snippet code as in:
Code Language="SQL"><![CDATA[SUM($selected) AS $selected$]]>
Do you know another way ?
I tried many SSMS addons. None is able to do this 🙁
There's an alternative with an extra step that might work a few comments back.
April 13, 2020 at 4:54 pm
Yeah, I think Luis' suggestion of making it an expansion template is the way to go. There may be a way to make it work using XSLT, but that seems like overkill, and I'm not sure it's really any easier.
I tried declaring a variable and populating it with the $selected$ value, but it still won't work. Doesn't recognize the placeholder in the Declarations, even if I use the CDATA tags, and only drops the value in as a replaceable field instead of actually putting the value in.
-------------------------------------------------------------------------------------------------------------------------------------
Please follow Best Practices For Posting On Forums to receive quicker and higher quality responses
Viewing 5 posts - 31 through 34 (of 34 total)
You must be logged in to reply to this topic. Login to reply