Author |
Message |
Mindflux
Joined: 25 May 2013 Posts: 846 Country: United States |
|
|
Thu Nov 03, 2016 9:46 pm |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7948
|
|
|
|
You cannot select a subset of cells and have only selected cell scripted. But you can certainly script the result set of simple queries. By simple I mean results of quick data preview and simple SELECT queries like
SELECT * FROM myTable WHERE colA < 100
Right-click the data-grid and choose Save as Script menu. Choose output options and it will save as script containing INSERT commands for the rows in the data-grid. The target database dialect depends on the selected Options. The script can be saved to a file or written to a new new code pane, from which with one-click you can copy it to the editor

|
|
Thu Nov 03, 2016 10:13 pm |
|
 |
Mindflux
Joined: 25 May 2013 Posts: 846 Country: United States |
|
|
|
"Save as Script" is greyed out for me.
I did a simple select (no joins)...
the where was WHERE WSID='MyWSID'
if I take the where out, the save as script is usable.. but now I have far too many results to sift through?
*Edit: Doesn't matter what I'm selecting for the WHERE. It greys out the Save as.
|
|
Fri Nov 04, 2016 8:58 am |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7948
|
|
|
|
Are you running 9.0.176 or an older version?
Does the table have primary key?
Is that menu enabled when you right-click that table in database explorer and select "Quick Data Preview" command?
|
|
Fri Nov 04, 2016 9:53 am |
|
 |
Mindflux
Joined: 25 May 2013 Posts: 846 Country: United States |
|
|
|
 |
 |
Are you running 9.0.176 or an older version?
Does the table have primary key?
Is that menu enabled when you right-click that table in database explorer and select "Quick Data Preview" command? |
Running 9.0.176
Yes PK
Yes
It's only when I add a where clause to my TSQL statement where the right click option goes out.
|
|
Fri Nov 04, 2016 9:55 am |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7948
|
|
|
|
Weird, I tested it with several tables and it doesn't seem to work consistently. For some tables it works with a WHERE clause, for some it doesn't. I also observed that whenever Save as Script is disabled, the Edit mode is disabled too. But when I use Quick Data Preview or drop the WHERE clause, then it works for all of my tables. I'm going to ask for more help on this one, and will get back to you early next week.
|
|
Fri Nov 04, 2016 11:18 am |
|
 |
gemisigo
Joined: 11 Mar 2010 Posts: 2165
|
|
|
|
I tested this one and experienced rather erratic behavior. I was unable to find any tables that would leave Save As Script enabled when querying with WHERE but figured out that (not) having a statement terminator (;) affects the state of mentioned context menu item.
|
|
Fri Nov 04, 2016 5:50 pm |
|
 |
Mindflux
Joined: 25 May 2013 Posts: 846 Country: United States |
|
|
|
 |
 |
I tested this one and experienced rather erratic behavior. I was unable to find any tables that would leave Save As Script enabled when querying with WHERE but figured out that (not) having a statement terminator (;) affects the state of mentioned context menu item. |
That's odd (and I can comfirm) that leaving the (;) off on a generic select with no where works, add the semi colon and suddenly you can't script it at all.
On top of the other odd behavior.
|
|
Fri Nov 04, 2016 6:01 pm |
|
 |
Mindflux
Joined: 25 May 2013 Posts: 846 Country: United States |
|
|
|
It appears this one is still open.
|
|
Wed Nov 23, 2016 9:43 am |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7948
|
|
|
|
 |
 |
It appears this one is still open. |
You are correct. The fix for this issue is still developing.
|
|
Wed Nov 23, 2016 7:56 pm |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7948
|
|
|
|
 |
 |
 |
 |
It appears this one is still open. |
You are correct. The fix for this issue is still developing. |
The fix for this issue is available in the latest released build 9.0.194
|
|
Fri Dec 02, 2016 2:09 am |
|
 |
|