Reports doesn't use changes in content with query - sql-server

In SSRS I have changed some tablenames and want to change the queries in all the reports that use those tables.
I have no trouble changing the queries. But when I run the reports in reportmanager they still use the old code.
If I edit the report in reportbuilder I can see that the code is changed.
If I save the report in reportbuilder then the reportmanager uses the correct code.
How do I make the change through a query without having to open each report and saving it again?

You can create a SYNONYM for the old table name to reference the new table name and your reports will still run correctly.
CREATE SYNONYM OldTableName FOR NewTableName
For more information please see this excellent introduction
http://www.sqlservertutorial.net/sql-server-basics/sql-server-synonym/

Related

Crystal Reports: only field headers showing up. No data

I'm new to CR (this is my first experience in fact). I'm trying to create a report based on a stored procedure I created in SQL Server 2012.
The SP is relatively simple and it runs just fine within SQL Server: all the data is right there in the results.
However, when I created a new standard report in Crystal Reports (2013), I'm able to access my server and database, select the SP, and the fields I want to use. It goes smoothly until I select "Finish". When the report loads, there's only the field headers from the SP.
I'm lost. I've tried it many times and continue to have no data. When I right-click to check the connection, it confirms connection. When I right-click on a field in the field explorer (I believe it's called) to view the data, there's nothing there.
The strange thing is, I created a view in SQL Server with the same query and when I added that view to CR, it worked fine. All my data was right there.
I also tried using a few other SPs in the database and I had the same issue —headers with no data, so I'm pretty confident it's not the SP itself.
Note: after selecting my SP and field when starting a new CR, I'm presented a window to choose the data range (which I assume is based on a date time parameter I have built into the SP). I didn't choose a date range because the end user will be selecting the range they need, so I checked the null boxes. I doubt if this plays any part, but I figured I'd mention it.
There must be something simple I'm missing here. I just don't get it. Any ideas? Thanks for taking the time to help.
put your code and SP so that i can identify

Update Multiple SSRS Reports in bulk

I need to make identical changes to hundreds of reports, and I was hoping to do this via SQL instead of each indvidual report and it's query. I can extract the report query via xml and generate my list of reports, their location, and the query being used. But what I cannot figure out is how to update the report query and then get that updated back into the Catalog? database so that the report itself reflects the changes when executed? I have never seen where this is possible, but maybe someone on here has tried to do this or knows that it's flat out not possible.
I could use SSIS and do this, but I would prefer not to download all the RDLs and then update, and then redeploy/upload the reports. Was hoping to update in place the reports/RDLs.
You shouldn't have to download the RDLs, they should already be in your source control system, and ideally collected and grouped into project(s). If so, you are in luck - you can use the global search/replace capabilities of Visual Studio (BIDS) or Notepad++ to make your change.
If your change was to the structure of the report then you could simply write a quick nasty console app to load the RDL and manipulate the XML structure. But things like the report query are held as free-form text in a node, making it harder to apply mass updates in a reliable way.
You could look to refactor the report queries into stored procedures and/or functions, this will make future updates a bit easier. In any case if you change the report RDLs you've got no option but to republish the modified ones - there's no such thing as an in-place change on the server (having your queries as stored procedures would have avoided this issue).

Stimulsoft Server Designer

What I want to achive is me giving a DataSet to the Report Server, which automatically uses this DataSet to create a report that has been pre-designed for this data.
My guess is to make use of the Object Tab, primarily the "Data from DataSet, DataTables" option in the Report Designer on our Stimulsoft Server.
After going through the Docummentation I could not find anything more about how to actually use it.
I have tried uploading a VisualStudio-DataSet(.xsd), but I can't attach the file to my report. No Errors, it just is does not let me attach to it. Other DataSources (e.g. Excel Files) do work.
What should I do? Is there another way for me to send DataSets to the Server and get a report out of it? Other connection types like SQL would work but are not relevant for this case.
Also, we are using the trial version for now. Pretty sure this does
not affect my problem in any way but I'd better add this information.
In this case, you can add new XML connection in which specify .xml or .xsd files and then select necessary tables.
https://i.stack.imgur.com/qUVw7.png

SSMS - Generate Scripts - Data Only doesn't work with views?

I am trying to generate a data only script for a view using SSMS Generate Scripts feature. However, even though I select Data Only, it still only generates the view definition and not the data generated by the view. Is there something else I need to do?
I'm using SSMS for SQL Server 2014.
I know this is old, but I will answer it for other people who stumble on it.
Generate Scripts -> Data Only is bugged for views.
The easiest option without searching for other stored procedures or external tools is to copy the view contents into a table. Generate Scripts -> Data Only works fine with tables.
For example,
SELECT *
INTO NEWTABLE
FROM dbo.Component
Then you can do Generate Scripts on the NEWTABLE and select Data Only in Advanced and it will work.
You can then delete the NEWTABLE.
Given that Generate Scripts still doesn't appear to work for view data as of SSMS v17.9.1, an alternative depending on your needs might be to use the SQL Server Import and Export Wizard. You can read data from a view and write it to a table, across different databases and servers without resorting to a linked server.
SSMS is still poor at this, VS has been able to do this for a while
Use menu VIEW->SQL SERVER OBJECT EXPLORER
Create a new server
Navigate down to your table or view , right click -> View Data
use the filter to limit the dataset to what you are interested in
Then use the SCRIPT command (also available on context menu)
This works for views and tables.
Not super easy, but ill give it A-. Way better than other hacks that used to be available (including SSMS.ExportData which is not great)
hope that helps someone. I just had to export some rows and had to re-remember how to do this.
hope it helps someone...
greg

Visual Studio DataSet Designer Refresh Tables

In visual studio datasource designer is there any way to refresh a table and its relations/foreign key constraints while keeping the custom queries?
The way I am doing it at the moment is removing the table and adding it again. This adds all the relations and refreshes all fields.
Also if I change a fields data type, is there a way to automatically refresh all the fields in the datasource? Again without deleting the table and adding it again.
Reason for this is because some of my TableAdapters have quite a number of complex queries attached to them and when I remove the table the adapter gets removed as well including all its queries.
I am using Visual Studio 2008 and connecting to a MySQL database.
Any1 have an idea?
Each table has a default query (The one on top with the check on it). When you dragged your tables in to the dataset to create the query, it wrote a SQL statement which it uses to schema your table. Keep that query simple, you might not actually use it in code, and you can always edit that query to update the table schema.
Every time you open the default query it connects to your datasource and allows you to select new columns that weren't in there before. If you want to update your existing columns, delete all the columns out of the table before you attempt to open the query. When you save the query, your updated columns get added back.
Make sure your connection string has permissions to view column information.
I reported this to MSFT but no response. The designer hangs all the time on the simplest of SQL statements. What I found that works for me is.
Add a new table to the designer.
Save it.
Shut down visual studio 2010.
Start VS 2010.
Add one or two more SQL statements and follow steps 2-4 again.
This is a pain in the neck but the only thing that stops Visual Studio dataset designer from hanging. I experienced in this same issue in VS 2008. I am connecting to Oracle but still shutting down VS and starting it back up works, but really, this is nonsense.
You can add/change/remove fields and relation ships, but i would suggest looking into NHibernate.
You should be able to right-click the dataset in solution explorer and select "Run Custom Tool" to refresh the table and it's query/relationships.
If that command is not there, check that the dataset properties has "MSDataSetGenerator" in the Custom Tool field.
Right click on your DataSet name and select Dataset Properties
Below the Query box you will see a button for Refresh Fields.
Click on Query Designer and the new field should show in your table list.

Resources