Regarding get automatic columns in sql` - mysql

I have basically 50 fields in a table and I want to select this fields from table on a regular basis.
Problem is: I have to write all this 50 fields manually.
Is there any shortcut in intellisence or any other tool where I can get all fields. automatically by pressing tool.
Also guys if anyone knows here extra addons on sql..then please post it here.

I'm a bit late to the party here (answer already accepted) but here goes anyway...
Did you know that you can drag the columns from the table to the editor window in Sql Server management studio?
So to get the columns, you can expand the table in SSMS, click on the Columns item (for lack of a better word) and drag it to the editor window. When you release, a comma separated list of all the columns for the table will be inserted to the editor at the position you point to.
It's not a easy as autoexpanding *, but it's a good little trick when you have lots of columns.

Check this http://www.devart.com/dbforge/sql/sqlcomplete/download.html link.
It may help you. Its a great intellisense tool for sql. Its has all functionality to improve productivity.

try this:
select name+',' from sys.columns where object_id=OBJECT_ID('tablename')
Now you just need to copy the result and put after the select keyword

Related

flatten results onto one line in report builder

report example
i have a report that displays client contact details, but annoyingly for each different contact type it displays the results on a separate line! Can anyone advise if it possible to show the results on one line using an expression or some sort of filter, not using SQL.
as you can see from the image Miss S has both a mobile (MBL) and telephone (TEL) number but they show on different rows, if in my program i were to add an email address then it would add a third line, is it possible to flatten the results down to one row?
regards
You'll need to remove the Contact Type column from the tablix as this won't be valid once you put all the contact details on the same row.
Once this is removed, you will then need to edit the row group (under the main design window) and group by the first 5 columns only. There may already be grouping set, if so check that contact type is not in the group by list, if it is remove it.
Alternative
After saying all this, I can't help but think this report would be a whole lot easier, assuming the data was structured correctly (it may already be), to use a matrix control. That way all this and the answer to your previous question (asked recently) would be automatic. I won't go into detail but if you are interested, create a new question and show the output from your dataset query, the query code itself and the desired output. optionally, accept this answer ! :)

Finding the max value in Power BI Column

I am sorry for bothering you with my issues and I am totally aware that this is probably pretty easy to solve. I also already searched the Internet but I am not able to apply the things I found.
I am totally new to PowerBi but need to fix this issue real quick.
So when I go to "Edit Queries" I have different tables on the left.
In one of them I've got one column for date, one for time and one for power output.
Now I want to find the highest value in "power output" and show this value and the date and time on the dashboard. What is the best way to do this? Add a new column? Add a new measure? And how do I do this? Which code do I need to use?
I really trying to learn by myself but I have literally no idea.
Please consider that I probably won't understand any technical terms..
Thank you very much.
There are several ways to achieve this...
In Power BI Desktop, Open the Report View
Create a new Measure (I called mine MaxValue, Numeric field = Cost)
Enter the formula :
MaxValue = MAX('Table'[Cost])
Add a Card to your Report,
While selecting the Card, drag that Measure : MaxValue to the Fields location on the right.
Edit Queries can also be used by manipulating values in columns, aggregations, etc; but not required here.
See pictures:

Insert a separator into a dropdown list in SSRS

I have a report that pulls information on tools. I have a multi-value parameter setup in SSRS that pulls a tool name and GUID and then passes the GUIDs to a stored proc for results.
The tools have in addition to name and GUID a value of active. I want to display a list of tools with active items first, then inactive. Easy enough that's just an order, however I'd like to put a visual separator between active and inactive tools. I can achieve this by creating an order value based on active status, and then using union to attach a dummy line between them.
However this means its possible to select the separator line. I can handle that line in my stored procedure so it doesn't cause a problem, but I'd like to make that line unselectable or to have a separator similar to what you see in a dropdown menu.
Does anyone know of any functionality that will achieve this?
I main project is currently help in 2008R2, but I may be able to upgrade if there is a good solution to this.
Many thanks in advance.
OK - have found there seems to be no way of showing a separator as such short of coding in a separator line in the data set. Final solution was close to my original plan. I now download two datasets, one of all tools (Active, separator, inactive) and attach this to my available values, and one of active only, which I then attach to my default values.
This means that both are available, but default is active only. Not a solution to the exact question, but best that I could come up with and is close enough to fit for purpose.
If anyone does come across better solutions, I'd love to here them.

Pivot Table Prompts Duplicating Values

I'm trying to replicate a report from old Oracle Discoverer to OBIEE.
The issue is that when I had the "pivot table prompts" to the OBIEE analysis. I'm left with duplicates instead of unique values in the drop down field. Can anyone explain how I can keep this from occurring? This only happens when I add three or more attributes/columns to the "pivot table prompts" section. This worked in Oracle Discoverer….
Be sure, for the physical connection you have defined, that you have checked the below option:
Also, I know there was a bug around this sort of functionality occurring if the column properties were set to repeat, but that is not a common thing people do, and is probably not your scenario, but it is worth a look: Bug 13147411 : 11G PROMPT IS DISPLAYING REPEATING VALUES WHEN ITEM PROPERTIES SET TO REPEAT
As mentioned by rmoff, incorrect keys can often lead to this issue. As he said, you can check the nqquery.log to see the physical SQL, or enter SET VARIABLE LOGLEVEL=4; in the SQL prefix on the advanced tab, then run your report again. This will generate a log in the admin pane of the tool that you can check easily.
The dropdown list is built from the dimension you have defined, so if your key is incorrect you'll get duplicates. Check the physical SQL in nqquery.log if in doubt to see what SQL OBIEE is generating that returns the duplicates, and make sure you have defined your logical dimension correctly.
The issue was resolved by moving "Repeat" to "Suppress" for the individual columns that I was prompting on in the pivot!
We did this a lot throughout my department because we use the exports for further manipulation rather than using OBIEE only for high level overview and summation. Each row must hold the value in order to filter, so the "Repeat" functionality is often selected.
Thanks for the help/answer!!!

SQL Server 2008 IntelliSense - How can I use Tab instead of Return to complete the text?

I am a software developer and most of my development tools offer IntelliSense where you use the Tab key to complete the text. Now that I'm using the IntelliSense features on SMS 2008 I instinctively hit the Tab key, which fills in the text with SQL commands instead of completing the text.
For instance, if I have a table called Documents and it has a DocumentID IntelliSense offers DocumentID when I hit the letter "d". If I hit the Tab key accidentally instead of the Enter key it fills it in with DELETE. I would like to use my Tab key to complete the text if possible.
Thanks!
Not 100% sure that you can, but I use SSMS Tools and haven't looked back :o)
Here's some tips I've found for dealing with the quirks and idiosyncrasies of IntelliSense, especially for column names.
First, fill in the FROM portion of your query before the SELECT.
SELECT
FROM MyTable
Second, always alias your tables (which IMO, is always a good practice anyhow).
SELECT
FROM MyTable mt
Third, when completing the SELECT list, use the table aliases. Once you type the period, IntelliSense should show you only the columns relevant to that table. At that point, the TAB key should work as you'd expect.
SELECT mt.
FROM MyTable mt