SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
Save as script is scripting all table data ( 10 beta)

 
Reply to topic    SoftTree Technologies Forum Index » SQL Assistant View previous topic
View next topic
Save as script is scripting all table data ( 10 beta)
Author Message
THenrich



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

Post Save as script is scripting all table data ( 10 beta) Reply with quote
I did a select top 10 * from sometable and ctrl-shift-F9. Got 10 rows back. Selected save as script to a new pane and it created insert statements for the whole table (> 200000 rows) instead of the 10 displayed rows.

Also, it creates insert statements with the identity column. I would like to see an option to not include it. Otherwise, all my selects have to be expanded and I have to remove the identity column.

v. 10 beta.
Thu Aug 23, 2018 3:22 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 6749

Post Reply with quote
It generates the script for the entire table because it needs to know where to insert the data too. A query result set does always have a table associated with it, or may have multiple tables in the result set.

Maybe you can create a temporary view from your query and then script data from that view to file. It will have only the rows and columns returned by the view.
Thu Aug 23, 2018 5:10 pm View user's profile Send private message
THenrich



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

Post Reply with quote
On page 186 of the 9.5 pdf, this is what it says. Based on it, doesn't it mean the query result window?

Important Note: The Save as Script command scripts out the complete window content, which in the case
of the Table Data Preview window, may or may not be the complete table content.
Thu Aug 23, 2018 5:30 pm View user's profile Send private message
THenrich



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

Post Reply with quote
SysOp wrote:
It generates the script for the entire table because it needs to know where to insert the data too. A query result set does always have a table associated with it, or may have multiple tables in the result set.

Maybe you can create a temporary view from your query and then script data from that view to file. It will have only the rows and columns returned by the view.



So there's no way to script the data from either grid, SSMS's and the one from SA? This is a serious limitation.
Thu Aug 23, 2018 11:52 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 6749

Post Reply with quote
May I ask for a sample query whose results you would like to script out using table inserts? Wonder how genetic it is.

If it's more or less generic, perhaps the desired function can be achieved by using the script generator feature.
Fri Aug 24, 2018 1:46 am 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.