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$')
![](https://secure.gravatar.com/avatar/398ebfc9b6eb883741f58a40f6dc0002?size=40&default=https%3A%2F%2Fassets.uvcdn.com%2Fpkg%2Fadmin%2Ficons%2Fuser_70-6bcf9e08938533adb9bac95c3e487cb2a6d4a32f890ca6fdc82e3072e0ea0368.png)
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$')