New training course: Customizing SQL Prompt. Watch now.

Update Statement Snippet

How would I create a custom snippet for update statements. We use very specific naming conventions so it is easy to create an update statement template. If I for e.g. select 3 columns in the column selection popup called Id, Description and Firstname, my snippet would need something like :

Update data.TestTable
SET
Id = @Id,
Description = @Description,
FirstName = @FirstName

I therefore in the snippet need to get the selected columns and for each column have a

ColumnName = @ColumnName after my SET Statement.

Update statements take very long and there is not a lot of efficiencies in it.

Best Answer

  • way0utwestway0utwest CO, USAPosts: 307 Rose Gold 1
    Accepted Answer
    We don't have the column picker in the UPDATE, which is a hole. I've noted this to the product team.

    However, the pattern of adding the column name in there is interesting. I don't have a Prompt solution for you right now. Certainly, you could use Shift+ALT to help here. Here's what I'd do: https://youtu.be/XdIA0EFrXOU

    Let me know if this helps. I've logged this with the team for discussion.

Answers

Sign In or Register to comment.