What are the project settings in SSRS deployment? - sql-server

I have successfully created my first SSRS project in Visual Studio. The deployment process requires setting up the TargetServerURL and the TargetServer Version. These are the only two items that I know are correct. The tutorial I have been watching does not go into the other items and does not clarify what they are and what they are used for. What are the following items referring to?
TargetDatasetFolder
TargetDataSourceFolder
TargetReportFolder
TargetReportPartFolder
The default settings for OverwriteDatasets and OverwriteDataSources was False and this is probably why my deployment attemtp threw a nondescript error. So, now, perhaps if I try again, my deployment will create these folders on the server by force, but I owuld rather not do this because the database manager has already given me the names of the folders where I should deploy. So, how are these Folders arranged? Please advise.

TargetDataSourceFolder: The name of the folder in which to store the published shared data sources. If you do not specify a folder, the data source is published to the same folder as the report. If the folder does not exist on the report server, Report Designer creates the folder when the reports are published.
TargetDataSetFolder: the same but for your shared data set you want to publish.
TargetReportFolder: The name of the folder in which to store the published reports. By default, this is the name of the report project. If the folder does not exist on the report server, Report Designer creates the folder when the reports are published.
You can write a path (finance/dept1/...) in this case, you'll deploy your report (or datasets or datasources) following this path.
Here is an exemple by default from microsoft:
About 'overwrite dataset' and 'overwrite datasource' (it's about 'shared dataset' and 'shared datasource') it depends on the architecture you chose (or if you have already something created) on the server.
I think the best way is to let them as False. If they don't exist, the deployment will create them. If they exist, you'll just get a warning (if I remember) and the report you'll be deploying should link your report to those dataset and datasource already created. Futhermore, probably you have other reports linked to those shared datasource/dataset and if you overwrite them, you'll probably raise some issues when you'll run those other reports. You have to put 'True' when you want to modify the dataset/datasource

Related

Dpac File - Errors

I have a problem with unresolved referenced in synonyms with a VS2013 Database project I have created for Team Foundation Server, which cause the project to not build. The synonyms reference another Database on the same server. I have seen online there are 3 main ways people handle this. I am going for this approach 1.
Create a DPAC file and add as a Database reference in Visual Studio Database Project.
Bring in the other database project in the current team Foundation Server project ?
Set the build action to None for the failing scripts that have the unreferenced synomns.
So when I go to extract the DPAC file from the Database it fails with an error.
Validation of the schema model for data package failed.
Error SQL71564: Error validating element [UAT_*********]: The element [UAT_*****] has been orphaned from its login and cannot be deployed.
( There is about 9 similar messages with other logons as well)
Is there anyway to bypass this and generate a valid DPAC file from sql server ?
If you need a .DACPAC file as a reference to your database projects, there is no need for referencing object to have any real code - As long as the signature met the requirements that the reference from Database Project was looking for, it will be just fine (syntactically valid).
You do not have to create a .DACPAC directly from SQL Sever, you can create a new empty Database Project, create/import all objects needed as references and then "Snapshot Project". This will generate valid .DACPAC and keep the size to minimum, which then you can put under source control.
If you wanted to create a .DACPAC from SQL Server, then I am afraid you would have to delete those objects, because it is unable to find logins in master database that are associated with them.
Great article to read about your approach 1 :
A complex database project
Hope this helps.

SQL Server Database Project

I want to use database project for script deployment in Azure SQL Server, I don't want to import full database. I just want to use database project for delta script. I added a project and included one script file with none as build action that contains create table statement , I am publishing the project, It's completing successfully but create statement is not executing. What is wrong here? Is there any other way to do this?
TLDR: Set your build action to "Post Deployment Script".
Longer:
What happens in SSDT is that all the files that have a build action of "Build" are built into a model of what the database should look like. When the deploy happens that model is compared to the target database and if there are any changes, a change script it generated and then optionally deployed.
If you have any file marked pre or post deployment script then they are either prepended or appended to the change script and will be run as part of the deployment.
If you have any files with a build action of "None" then SSDT ignores them, you could put anything in there, even an ascii picture of a donkey and the project will still build and deploy (obviously your ascii donkey won't get deployed anywhere).
If you just want to use SSDT to do your deployments you can just set the build action to pre or post deploy and it will be included. This is pretty odd though, either don't use SSDT or use SSDT and put the model of your entire database in there.
Personally, I would use SSDT properly and live the dream.
Ed

How do i use an SQL query to determine TFS Area name and build path including file name for installers

I am trying to automate the release process associated with installers that have been created on my build server. To do this I was hoping to be able to use an SQL query to get the drop path of the installer including the file name.
In TFS when I go to "Build" and select "Artifacts" I can then use the "Explore" link to get the root path for the build. The subsequent folders "Installer\Disk" path is part of the configuration. However, the actual setup file is composed of the + " setup.exe". Since there are multiple projects in our TFS I was hoping to use a query to find all builds that have a build quality set to "Release" and dynamically find the installer on disk.
Generally our installer names are made up of the root area path name with all text removed. I can't figure out how to connect the build to the root area path in SQL.
Any ideas?
Generally, Accessing the information from Database directly is not recommended since it is in a high risk. I would recommend you to use TFS API to do this.
The drop location of the build is stored in TFS Collection Database\tbl_Build table and the quality information is stored in tbl_BuildQuality table. Join these two tables to query the information you want.

How to deploy ssrs report on production server

I had created few SSRS reports on the development environment. Now I need to deploy those reports to the production environment. The production environment server name & database names are different from development environment.
Kindly let me know the proper procedure for deployment.
Create two different ptoject configurations in the configuration manager - name them f.e. "Development" and "Production". Then, in the project properties, set up the server names and report folders for both prod and dev configurations as necessary. By doing this you will be able to choose a right configuration when deploying and your reports will be deployed to a correct server.
It is not that straight forward for different databases though. What I would suggest here is to create a shared datasources in both development and production environments with the same name, configure the connecction strings properly and use the shared datasource in your reports. You will need to create the datasources only once, and all the consiquent deployments will still refer to those datasources.
Hope it helps.
To deploy the report go to Project > Project properties and the following window shall open up
Fill the server name in TargetServerURL (marked 1 in red). Your server name should be http://{servername}/RerportServer.
After this you can use a custom folder where you want to deploy the reports (this is marked as 2). Keep the rest as same.
Since you have different DB names as well you can do a number of things to address this issue.
You can create a shared Data Source like #Alexey pointed out.
Press CTRL+Alt+D to open up Report Data menu and create a new Data Source, copy your query there and redesign.
Hope this helps.

How does the ClickOnce installer handle updates when a compact database is involved?

I have a simple WPF application that uses ClickOnce to handle installing. Within this application is a compact database. Through testing I have found that when I publish a new build this database will get overwritten, which is not what I want. Is there anyway I can have fine grained control over what files are updated? I assume ClickOnce is simply checking the hash of the database file, deciding that it has changed and pulling the update.
As a workaround I have since removed the database from the files that are included with the published application so the original remains on the client machine after an update, untouched.
Not a great solution I know
Thanks,
ClickOnce deployments segregate the Application Files into "Include" or "Data file". You can specify what each file is in visual Studio by going to the project Properties page, Publish tab, then clicking the "Application Files..." button. You can then set your .sdf file to "Data File" under the Publish Status column.
Data Files that are downloaded with a ClickOnce application are then placed in a separate directory for each new version.
The idea is that on the first run of the new application version, you go retrieve all the user's private data from their old-version data files and incorporate that data into the new data files which have just been downloaded with your new version.
I think you'll find the information you need at Accessing Local and Remote Data in ClickOnce Applications. Specifically, look at the sections "ClickOnce Data Directory" and "Data Directory and Application Versions."
To access a SQL Server CE database located in your Data directory, use a connection string similar to the following:
<add
name="MyApplication.Properties.Settings.LocalCacheConnectionString"
connectionString="Data Source=|DataDirectory|\LocalCache.sdf"
providerName="Microsoft.SqlServerCe.Client.3.5" />
The "|DataDirectory|" is a special syntax supported by SQL CE and SQL Express and resolves at runtime to the proper directory.
If you so much as open that SQLCE database included in your project, it will change the time stamp on the database, and ClickOnce will deploy it and put the old version under the \pre subfolder.
You might want to consider this method for handling this. Then if you accidentally deploy a new version of the database and don't realize it, you're not hosed. If you intentionally make changes, you can change the database structure of your current database with SQL queries, and pull data from the new copy deployed to the Data Directory (that you're otherwise ignoring) when you need to.
RobinDotNet

Resources