SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
Feature: Insert Helper

 
Reply to topic    SoftTree Technologies Forum Index » SQL Assistant View previous topic
View next topic
Feature: Insert Helper
Author Message
judahr



Joined: 09 Mar 2007
Posts: 319
Country: United States

Post Feature: Insert Helper Reply with quote
When you are inserting a bunch of fields in a table, it would be nice if the popup would tell you the field you are inserting into. Example:

Code:
Insert dbo.Table1( Field1, Field2, Field3, Field4)
Select


At this point, one of the columns that could be added is something that says Field1. Once you are on the next column, show Field2. And so on.
Mon Oct 25, 2010 9:40 am View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7849

Post Reply with quote
SQL Assistant currently supports column hints in INSERT..VALUES statements. I don't think INSERT ... SELECT can be handled in the same manner, because the priority after SELECT keyword is set for the tables/views referenced in the SELECT statement, not the table referenced in the preceding INSERT.

You most likely know that already, but just in case, please try choosing table name in the popup appearing immediately after INSERT keyword, SQL Assistant will generate the entire statement for you, including all the columns. In the generated code, replace VALUES with SELECT and you get almost what you described, all the columns. To quickly uncomment columns you want, highlight the block of code containing column names and press Ctrl+\


Last edited by SysOp on Mon Oct 25, 2010 6:28 pm; edited 1 time in total
Mon Oct 25, 2010 10:20 am View user's profile Send private message
judahr



Joined: 09 Mar 2007
Posts: 319
Country: United States

Post Reply with quote
Yes, I know about the insert auto-output everything. This is for more complex inserts with tons of columns. My idea would be to detect you are in an insert while in the select. Then append a column to the field popup that shows the column name you will insert into.

Btw, that auto-output everything doesn't seem to work reliably. For example, if you type the first few characters of the tables (so you can find it), then click tab, doesn't output. Seems to only work when you use the arrow keys.
Mon Oct 25, 2010 11:01 am View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7849

Post Reply with quote
Does it work when you are you using Enter key? There needs to be something selected the popup list before you can pick it. Tab key is a not a best choice for that, it doesn't change any selection.
Mon Oct 25, 2010 6:32 pm View user's profile Send private message
Display posts from previous:    
Reply to topic    SoftTree Technologies Forum Index » SQL Assistant All times are GMT - 4 Hours
Page 1 of 1

 
Jump to: 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


 

 

Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Flowers Online.