feature suggestion

DanAvniDanAvni Posts: 68 Bronze 2
edited January 15, 2009 3:51AM in SQL Prompt Previous Versions
1. if i have a table with a string field and i am writing a SQL statement like this "Field=" i would like to see sql prompt add '' and put the caret in the middle of the tags. on unicode strings sql prompt should add N''
2. if i am typing "Field Like" the same rules as suggestion #1 should apply
3. if the field is a uniqeidentifier field then '' should also be added
4. if the field is a date field then a CONVERT(datetime,'',102) should be added so i can imidietly write the date i need (e.g. 2008-01-01 00:00:00)
Dan Avni


  • Thanks for your feedback. I've added these to our feature request tracking database and they will be considered as future enhancements.
  • While not as easy as the automatic completion, you could write some code snippets.

    I wrote one for "n", which inserts "N'$CURSOR$'", so in your case, I could just do "Field =" <SPACE> "n" <TAB>.

    Same for LIKE, just write a snippet (maybe "li"?) to insert "LIKE N'%$CURSOR$%'".

    To automate it, like you suggested, could be difficult. You could be writing a JOIN, and then you don't want the automatic ''.
  • DanAvniDanAvni Posts: 68 Bronze 2
    i agree that i could make up some templates but the main drive for this post was to make sql prompt more intelligent. another example is that when i write exec sproc_name i get a prompt for all variables and all equal ?
    exec sproc_name
    @guid_var = ?

    since it's obvious that to send the guid you would need tags around it sql prompt should be more intelligent on this and make it
    exec sproc_name
    @guid_var = ''

    i hope you get the idea
    Dan Avni
Sign In or Register to comment.