Improvement for INSERT command

EsioNEsioN Posts: 103
edited December 5, 2007 3:35PM in SQL Prompt Previous Versions
Hello.
It will be great if:

When typing INSERT command, SP could mount the column list (as we get when typing * tab in select from), and may a template with the datatype (as we get when typing exec procedures).
ex. insert table_a (colum1, column2) values (@column1 = ?, -- int, @column2= ? -- int)

Thanks
Ésio

Comments

  • Bart ReadBart Read Posts: 997 Silver 1
    Again, this is something we wanted to do for 3.0 but didn't have time to squeeze in. I suspect it'll make an appearance in a version in the not too distant future.
    Thanks,
    Bart
    Bart Read
    Principal Consultant
    bartread.com Ltd
  • Would also be useful if this extended to calling Functions...PITA having to remember the order of parameters being sought!
  • Bart ReadBart Read Posts: 997 Silver 1
    That's more of a tooltip/popup help issue I think since the only time it's valid to enumerate the parameters for a function invocation explicitly in the SQL is when you invoke with EXEC/EXECUTE. However, it's a very fair point and is certainly something we could provide more assistance with.
    Thanks,
    Bart
    Bart Read
    Principal Consultant
    bartread.com Ltd
  • PDinCAPDinCA Posts: 642 Silver 1
    Although INSERT INTO develops a prototype that is better than the VSMS "Script as INSERT", it would be EVEN BETTER if NULL/NOT NULL were shown in the comments, as in:

    /* CreatedTimestamp - datetime NOT NULL */ '2007-12-5 12:24:6.634',
    /* SentTimestamp - datetime NULL*/ '2007-12-5 12:24:6.634',
    /* AppliedTimestamp - datetime NULL*/ '2007-12-5 12:24:6.634'

    We can then easily trim the column list and VALUES/SELECT to mandatory columns and those we need to populate that are NULL.

    Could you add this to the enhancement list if it's not already there (a Search of the Forum evidenced no combination of INSERT and NULL that appeared to be in this context... If I missed it, count this as a vote for the enhancement :) )
    Jesus Christ: Lunatic, liar or Lord?
    Decide wisely...
Sign In or Register to comment.