 |
SoftTree Technologies
Technical Support Forums
|
|
Author |
Message |
THenrich
Joined: 17 Dec 2014 Posts: 20 Country: United States |
|
Save as script is scripting all table data ( 10 beta) |
|
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 |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7948
|
|
|
|
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 |
|
 |
THenrich
Joined: 17 Dec 2014 Posts: 20 Country: United States |
|
|
|
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 |
|
 |
THenrich
Joined: 17 Dec 2014 Posts: 20 Country: United States |
|
|
|
 |
 |
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 |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7948
|
|
|
|
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 |
|
 |
|
|
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
|
|
|