Comments
1 comment
-
Hi @mmosstx,
Welcome and thanks for contacting us.
Unfortunately, this is currently not possible in Prompt. We only have the $PASTE$ placeholder which inserts the contents of the clipboard without any type of special post-processing or filtering.
I recommend you add a request for this suggestion in our UserVoice forums : https://redgate.uservoice.com/forums/94413-sql-prompt
Kind regards,
Frederico
Add comment
Please sign in to leave a comment.
I'm a big fan of using the $PASTE$ placeholder when creating snippets. Typically I use them for Date formatting, example below:
Snippet Code examples:
So with a sample SQL query of
I would cut (CTRL+X) 'abc.Date' and insert the snippet, with 'abc.date' being inserted in the $PASTE$ sections. Example result would be:
It works great, except then I have to go remove the alias from the column name portion.
SO here's my question
Is there a way to create a custom placeholder, that basically works the same way as $PASTE$, but recognizes there's a table alias attached and removes it? i.e.
CONVERT(VARCHAR, $PASTE$, 101) AS $customPASTE$ = CONVERT(VARCHAR, abc.Date, 101) AS Date