How to modify an existing SSRS report using report wizard - sql-server

I'm sure I'm missing something obvious here but I've been searching for half an hour to no avail. In Visual Studio, if I right click on Report and select Add new report then I can do things like select the data source, and input a SQL query. If I want to (for example) change the SQL query of an existing report, how do I do this? Surely I don't have to delete & recreate the report?

You cannot reopen the wizard that you used to initially create the report (or chart). It's a one time wizard that generates a report that you have to manually tweak afterward.
The good news is that it shouldn't take too much effort to change simple things on the report you have. There are lots of examples on SO about how to change the query/expressions or anything else you need to modify.

I faced the same issue when I wanted to change my query and add a new field. A workaround is to manually modify the rdl file:
Righ click on your report (on the solution explorer)
View code
Paste your new query within the < CommandText >< /CommandText >
Add a new < Field >< /Field > in the list

Related

How to copy a record from Excel and paste into SSMS V 17 to update existing record

Folks,
I am a novice, really a business user (not techie), in SSMS v 17. I used to update a MS Sql Server database in Azure using Excel add-in (Devart), but then Active Directory Multifactor Authentication was introduced at the organization and I cannot use Devart any longer. I am forced to use SSMS v 17.5 to make updates to the database through that grid.
I found a few old (circa 2008) solutions for creating new records using Copy Paste from Excel. Similarly, is there a way to "update" an existing record in the database by copying a row from Excel and pasting into that "grid"? I have some 60+ and 70+ year olds in the team, and would really like a simple solution that could cater to all ages. Right now, we scroll right and left, furiously, inside the grid trying to ensure that we are updating the correct row of record.
I sincerely appreciate your guidance in this regard.
One way you can do this, though I do not recommend is:
1) Right click the table you want to edit, select edit top 200 rows.
2) Right click the screen that pops up, go to Pane -> SQL
3) Change this to show the records you want to edit and column in the order you want and it should work.
Big problem here and why I wouldn't suggest this, is if anything is wrong you could really mess stuff up, also it will lock the rows you are looking at which could affect other things. A better "work around" would be to create an excel function and use a template. Example : ="Update "&B1&" Set "&C1&" = '"&D1&"' where ID = "&A1 ... Essecially letting Excel write the dynamic sql. In this case B1 would be the table to update, Cell C1 would be the column to update, D1 would be the new value and A1 would be the unique identifier. I do this often when someone sends me a list of 1000 items and I need to put them in a temp table or something.

How to add a new column from a stored proc to an existing SSRS 2012 report

I have an existing stored procedure that I modified to return one more column. I need to get that new column into the existing SSRS report. The report is simple but I want to avoid recreating the whole report if possible. Thank you.
In DataSet properties, go to the "Query" tab. Press the "Refresh Fields" button, and click OK. Save the report. When you go to the "Fields" tab of DataSet properties, the new column should appear.
(This is for Visual Studio 2013. For other versions, the UI may be slightly different, but the basic approach still applies.)
The easiest way to edit the current report, most places I have worked have some type of file control like TFS. Another option is to download the rdl file off the server and edit it.
You have the dataset collection created for this , Edit that ( Ctrl + L ) add the new column name >> Save and refresh

SSRS Reporting - How to disable dataset?

My RDL file contain 10 different ds, dataset1... dataset10.
On document I am only using dataset1...dataset5 and rest are obsolete (dataset5 to dataset10)
Report is doing fine but having performance issue as dataset5 to dataset10 are unnecessary loading with the report. I have client requirement not to delete them ,he wanted keep the old logic.
Is there any way in SSRS where we can disable or deactivate these datasets not to load.
Please help me to this. Thanks .
vd
Why not just make a copy of the current report, then delete the unneeded datasets in the present version? That way you'll have a retrievable record of the old report and its datasets without having to deploy it to the reporting server. Just click on the report in the solution explorer, then press ctrl+c and ctrl+v.
For the moment, you can use a hidden parameter with a default value (say "1") and use that parameter in the obsolete datasets.
dataset5
select
code here
where #parameter <> 1

Refreshing a table in SQL server management studio

I have opened a table in SQL server management studio express.
How do I update it?
As changes made outside the studio application do not show unless I close and reopen the table. Surely there must be a better way of doing this?
In SSMS (SQL Server Management Studio) press Ctrl + R
In Visual Studio Press Shift + Alt + R
I am not sure if I understand exactly what you want, but if you want to see the changes, the query that loaded the table has to be re-executed. You can do this by clicking on "Execute SQL" (or selecting it from the context menu).
Depending on what you mean with "opening the table" (select top x rows, edit top x rows, etc ) you also might try to hit F5 (works for "Select TOP x Rows") - which simply executes the previous statement.
As a rule, manually editing data in SQL Server is a bad practice.
It's not repeatable. Anything you do is limited to your window and once it's gone it's gone.
It's easy to make mistakes. Click the wrong cell, fat-finger a decimal point, etc.
A much better solution is to create and save insert or update scripts. These are editable, reviewable, and rerunnable.
If you need to recreate your database or replicate something now, you need to manually type in all the same values you typed in before. If you script it out, you just run the script and can have the same data as many times as you can hit F5.
It is much easier if you just create a query referencing on that table. Then create select statement giving all rows from that table.

Edit data from result grid

I would like to edit data directly from result grid in ssms. eg:
When I execute SELECT TOP 10 * FROM some_table, I want to edit data directly from result grid.
I don't want to open some_table and edit from there.
I know that result grid is read-only, but maybe someone written addin for it.
You can't edit the data from within the result grid. You'd have to go via the "open table" route if you want to edit the data manually instead of using UPDATE/INSERT SQL statements.
Is there a reason you specifically want to use the result grid instead?
You can specify a query when you go via open table to limit the results if that's your reason? There's a "Show SQL Pane" button in the top toolbar you need to select (square box with "SQL" written in it).
I have very large database (70+ GB) with so many tables.
I'm using Red Gate's SQL refactor for intellisense and few other things.
It's so boring to type in update sql statements every time I need to change single field.
It also takes some time to find that table in the Object explorer.
Intellisense doesn't work when I use "Show SQL Pane".
I'm new to SQL Server and have used the Oracle product 'PL/SQL developer' by All Round Automations at a previous job... It would allow you to do a SELECT in the query window and then simply add "FOR UPDATE" to the end of your refined SQL SELECT and 'ta-da' you can now edit the results in a nice grid. No need to Open Table View, click the SQL button, paste in the SQL you you have been working on and then hit execute ;)
EMS SQL Manager for SQL Server allows to update data directly inside a results grid.
This tool is boring for typing new requests (poor intellisense and error management) but fine for this. I always have the two tools opened.
If you right click on the table and choose edit top 200 records, it produces a result screen with an query.
Add to this your query and then you can edit the records in the result screen.
Also you can change the 200 to a number you want (2000).
The "results" pane is not just results.
Results in text
Assorted time and IO statistics
Estimated and actual execution plans
Row counts, Error messages, PRINT output
etc
This is why they are separate.
Feel free to write your own add-in :-) Or here
SQL Server ISN'T Access!
When you run a query and get the results - thats exactly what you are doing, reading the data, not opening the table for editing. Can you imagine the necessary transactional control around allowing the results window to be edited? The locking would probably grind SQL to a halt - I hope no-one ever writes that kind of add-in!

Resources