Tony Henrich
  • Posts: 2
  • Joined: 7/27/2016
Sometimes I have a table with tens of columns and I have a select query which selects all the columns. I use the INSERT INTO template for the query result. It's hard to know which value belongs to what column. To make the inserts easier to read, I want to add the column name next to each value as a comment and on a separate line.

I tried to edit the INSERT INTO template and change the {values} template to:
{Value}, --{ColumnName}
and a value separator as \r\n

This works until the last column which creates a syntax error because there's an extra comma and closing parenthesis on the same line. I don't want the extra comma and the closing parenthesis needs to be on its own line.

Current wrong output:
34, -- LastColumnName)

I want it to be:
34 -- LastColumnName

How do I make the template work so it doesn't create syntax errors?
  • Posts: 287
  • Joined: 6/30/2012
Hello Tony,
well, currently this is not possible... I have added your case to our to-do list, but cannot currently say when we will implement this.
By the way: SSMSBoost allows to jump between column names and insert values. Try CTRL+Shift+UP/Down arrow, when cursor is located on Value or Column name.
  • You cannot post new topics in this forum.
  • You cannot reply to topics in this forum.
  • You cannot delete your posts in this forum.
  • You cannot edit your posts in this forum.
  • You cannot create polls in this forum.
  • You cannot vote in polls in this forum.