Snippet Manager - Placeholder For New GUID
It would be nice to have a placeholder that, when the snippet was used, was replaced with a new GUID. For example:
INSERT audit.Changes (Id, Date, Reason)
VALUES ('$GUID$', '$DATE$', '$CURSOR$')

This is included in SQL Prompt 7 which you can download from http://www.red-gate.com/products/sql-development/sql-prompt/
-
AdminAaron Law (Admin, Redgate) commented
Hi Jeremy,
We've just uploaded another beta build which allows you to user $GUID$ inside a user-defined placeholder eg. http://i.imgur.com/Hta9fql.png
This should allow you to use the same GUID in multiple places.
-
Jeremy Green commented
Great! Thanks for that. :)
What would make this even better is if we could somehow label the GUIDs and reuse them later in the query.
For example:
INSERT audit.Changes (Id, Date)
VALUES ('$GUID#ChangeId$', '$DATE$')INSERT audit.ChangeDetails (Id, ChangeId, DetailInfo)
VALUES ('$GUID$', '$GUID#ChangeId$', '$CURSOR$')