How to change the default value of 1000 in "SELECT TOP 1000" in Azure Data Studio? - azure-data-studio

The default value in Azure Data Studio for SELECT TOP 1000 query from the table pop-up menu is 1000. Is there a way to change it?
Searching all over the google shows you how to do that in Visual Studio, but not in Azure Data Studio.
Thank you.

It is not possible to change it. I went through the code source and I found out that is hardcoded. You can request it as a feature in GitHub
Maybe the implementation of code snippet can help, but you will have to set N and TableName every time which is not convenient. You can find more details about it here.
In case you want to do it, you can copy-paste this SQL snippet
{
"Select top N Rows": {
"prefix": "sqlSelectTopN",
"body": "SELECT TOP ${1:N} * FROM ${2:TableName}",
"description": "Select Top N Rows"
}
}

You can use the Select Top N extension for this.

Related

Table name becomes undefined when query is moved to new tab?

I have a query which is part of several queries in a tab.
I want to modify each of the queries by adding exclusions.
But when I copied the first query and put it in a new tab for testing, the table was underlined in red, and when you hovered over the text, it said 'Undefined table.'
Does anyone know why this would happen when the query is moved to a new tab?
I hadn't made any changes, yet!
The query looks like this:
SELECT
CONCAT ('DX COST',null) as "R List",
TRIM(T$SKU) as "SKU",
T$PDDP as "Price"
FROM TRITON.DDIITM001145
WHERE T$GSIZ NOT in ('LED','ODS');
The part TRITON.DDIITM001145 part of the query was underlined in red, when I copied the query and moved it into a new tab.
I've never seen that happen before?
Also, I'm not sure how to put the whole query in code, on here? I used the {} / code sample button to paste what you can see, but it didn't include the FROM statement?
Any thoughts would be appreciated!
Thank you!
In your new query tab, are you using the same database? Because our parser checks the data dictionary to see if it can find a view, table, or synonym called DDIITM001145
If we can't find it, you get the squiggly 'warning.'
This is ONLY a warning. It won't prevent you from running the query. It's just a heads-up that it might not work before you trying running it.
If you look at the Log panel, you can see where we query the database looking for your table.

Datagrip - get row count (easily) on queries with more than 500 results

Is there a way (setting or shortcut) for displaying the total row count of a query that outputs more than 500 rows - that is, without modifying the "Result set page size" value in preferences? I'm looking essentially for the output of select count(*) from (<query>) t in addition to the displayed rows.
Click on page-size of the result-set
You can change it in settings:
File --> settings
Then in Database --> Data Views --> Uncheck Limit page size to 500
Alternative to accepted answer (clicking to page-size), click the Last Page icon and it shows the count of items
Answering my own question and not accepting it because I'm hoping there's a better way, but you can create a live template:
SELECT count(*) FROM ($SELECTION$) tablenameyoullneveruse
Select your query, then use Surround with Live Template...
Still hoping for a simultaneous solution (not have to build 2nd query).

How to get all the rows in my results as opposed to only 100 rows?

I am using Microsoft Visual Studio 2012 Shell(Integrated) version.
When I right click on any table and select 'Query Window' I am able to write code to return values from an Oracle database. But when I run it, I get only 100 rows of the results.
How do I get all the rows of results? Is there an option I can check or uncheck to achieve that?
I don't use Visual Studio, but I suppose you need just press PgDown or End button in results table. Where PgDown - fetch next 100 rows. End - fetch all rows.At least SQL Navigator works that way.

SSRS - Parameter - SELECT ALL vs ALL - How to remove ALL option

Please look at this ss
I am using SSRS 2008 + pulling data from a cube and made Country my parameter.
I want to keep "Select ALL" option but remove "ALL" option.
How would I go about doing that?
Thank you
You need to replace the ALLMEMBERS function with the CHILDREN function.
http://www.bidn.com/blogs/ChrisAlbrektson/bidn-blog/1452/mdx-ssrs-how-to-remove-the-all-member-from-your-parameter <-- will show you what I mean

How to filter a query result?

Currently I can not quickly filter the result of a work-item query - running a query will give us a result table and within this table, there's no mean to filter the table rows to display just the ones containing some certain text.
Do you know how to filter that or have any addons/tools suggestion for that?
Thank you.
Nam.
You could use
Telerik's free Work Item Manager . It lets you search the text of work items as well as other useful filtering and grouping tools. Very useful.
We use Excel integration pretty heavily in our shop. The familiar sort and filter controls work well.
Not sure if this is what you are looking for:
You can "Edit Query" from the toolbox and save it as a new query.
After a while (long :) ), I luckily notice that there's a filter box if we browse the work items in the pending changes pane (open in VS 2010: View - Other Windows - Pending Changes). It's so nice that now I can quickly get the exact items I'm looking for.
Today, I found an addon that may fit my need: Search Work Items for TFS 2010
It is a search box, not exactly the filter for the current query.
(similar problem with this question)
I re-post the answer here:
After a long time, today I found the solution for this: use the MS VS 2010 Team Web Access to open your queries using a web browser!
Advantage when doing this:
No delay when clicking an item
Utilize all browser feature like searching, bookmark, ... to work with the queries
Enjoy!

Resources