SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
How to 'copy as sql insert' a selection from the grid?

 
Reply to topic    SoftTree Technologies Forum Index » SQL Assistant View previous topic
View next topic
How to 'copy as sql insert' a selection from the grid?
Author Message
THenrich



Joined: 17 Dec 2014
Posts: 20
Country: United States

Post How to 'copy as sql insert' a selection from the grid? Reply with quote
How to 'copy as sql insert' a selection from the result grid? It's creating all the rows and columns which I don't want. I also don't see an option to copy the results to the clipboard?
Fri Aug 20, 2021 1:37 am View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7414

Post Reply with quote
Hello. Are you using SQL Assistant SQL Editor IDE or something else?

Example below. This will only include columns that are show in the grid. If your query returns a subset of columns only those columns will be scripted.



Thu Sep 09, 2021 1:01 am View user's profile Send private message
THenrich



Joined: 17 Dec 2014
Posts: 20
Country: United States

Post Reply with quote
I am using the SSMS add-on.
Wed Sep 15, 2021 2:45 pm View user's profile Send private message
Mindflux



Joined: 25 May 2013
Posts: 709
Country: United States

Post Reply with quote
Can confirm OP's issue. If I select 3 columns out of a grid and do the "COPY AS SQL INSERT", it takes all the table columns with it.

Edit:
So you're saying it'll take all the columns in the result grid, so you need to pare it down first before using "COPY AS SQL INSERT"? You cannot highlight the columns you want copied (like your example seems to show is possible)?
Thu Sep 16, 2021 9:27 am View user's profile Send private message
Mindflux



Joined: 25 May 2013
Posts: 709
Country: United States

Post Reply with quote
In learning about this, I am wondering why the insert into statement is repeated multiple times, rather than:



Code:

insert into table (foo, bar) VALUES ('foo','bar'),('fooo,'baz'),(etc...)?

Thu Sep 16, 2021 9:39 am View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7414

Post Reply with quote
Mindflux wrote:
So you're saying it'll take all the columns in the result grid, so you need to pare it down first before using "COPY AS SQL INSERT"? You cannot highlight the columns you want copied (like your example seems to show is possible)?


Correct, it saves the grid data to the script, not selected columns or selected values. In your query you can choose what exactly need to be scripted. This enables you to choose which columns or subset of rows to include, as well as enables to to add computed expressions whose values you want to be scripted too. It's very flexible in that sense.
Thu Sep 16, 2021 12:24 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7414

Post Reply with quote
Mindflux wrote:
In learning about this, I am wondering why the insert into statement is repeated multiple times, rather than:



Code:

insert into table (foo, bar) VALUES ('foo','bar'),('fooo,'baz'),(etc...)?



Please wait for a little while. It's coming very soon :-)



Thu Sep 16, 2021 12:31 pm View user's profile Send private message
Mindflux



Joined: 25 May 2013
Posts: 709
Country: United States

Post Reply with quote
huzzah!
Thu Sep 16, 2021 12:32 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7414

Post Reply with quote
The beta version is out. An announcement with download link is in top message in this board.
Wed Sep 29, 2021 3:27 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.