Hi is there a way to edit the package.params file in a SSIS solution without visual studio?
I have a feeling that what you're wanting to do is set a new value for the package parameters at runtime. You can set these in the package store or in the execution settings, http://www.sqlchick.com/entries/2015/1/4/parameterizing-connections-and-values-at-runtime-using-ssis-environment-variables .
I found out that there are no external applications needed you can do it through environment variables and SSMS You can read the full article here
How to configure SSIS 2012 project to run under different environment configurations?
Related
I have been using XML config files for a long time. I know there are thousands of post on this. Most are not about SSIS VS2019. The ones that I found that do stop at how to setup packages. None explain what happens if it doesn't work. Upgraded all my packages from SSIS 2008 to 2019. Everything converts good except scripts. I setup my package configuration and try to run in debug it is still using the values in the package not the config file. I Also tried running them in Server Agent with the same results. Not sure where I went wrong or if its a SSIS BI issue. Please help, Thank you.
Add a existing 2008 package to my project
Had to rewrite all the scripts by copping the code. Create a new Script task\component. Paste the code in the new script close the window. Ran the project on my local DB. Everything worked.
Click on the packages background and then in the properties window open Configurations collection selected enable configurations.
Add a new configuration. Select values for Initial Catalog, Server Name, StartupDir, InputDir, ArchiveDir. Now points to Dev server and input directories.
Save the configuration.
In the package, I can now right click on the back screen and see Package Configurations as a selection. I open it and package configuration's is enabled and the file is visible.
Close the configuration put a breakpoint in the package.
Click Start, Check the variables in the locals window. They do not have the configured values.
If i let it run it updates my local db not the DEV one.
I ended up having to change the protection level to DontSaveSensitive and changing the target version to 2019. My local server is 2016 so not sure why DEV and Prod are 2019 so if I can debug on 2016 with a 2019 target I'm good with that.
Warning for anyone trying this. After doing this I received a bunch of errors when I tried to open packages with scripts. I had to open the script and close it to rebuild. Then it worked and the massage went away.
And before I forget there's this annoying little message. I just ignored it.
Please try to change SSIS Project/Package(s) ProtectionLevel setting to DontSaveSensitive.
Starting from SSIS 2012 onwards the preferred way is to use Project/Package level parameters instead of XML config files.
Using Visual Studio 2013 with TFS and SQL Server 2012 & 2014, and SQLPackage.exe with a Publish profile.
Does anyone know if/how to get the Build version or Assembly version into a SQLCMD variable?
i.e. I'm trying to obtain whatever system-level build versioning information TFS/Visual Studio has about an SQL project build and push this into a SQLCMD variable and then insert that into a table.
I know that I can explicitly define an SQLCMD variable and then manually set and increment the value of it, but I want whatever build version number has for the project.
I've been able to get the Assembly version info via MSBuild, as detailed here: https://social.msdn.microsoft.com/Forums/sqlserver/en-US/e0c93a55-d8bd-4a32-89d9-f46013fc1235/automatic-version-increment-on-datatier-applications?forum=ssdt
But that is outside of my post-deploy.sql script. I've tried simply referencing the $(IntermediateTargetAssembly) variable, but the project won't build and errors that this variable not been declared.
I realize this is a different deployment setup than you are currently using but I think you will find it may work out better overall.
http://dotnetcatch.com/2016/02/10/deploying-a-database-project-with-msdeploy/
You could set the build version on your MSDeploy package using the MSBuild property you found via MSDeploy Parameterization to update a SQL script that would insert or update the source version in your database.
So SSIS 2012 requires all your packages and your project to have the same ProtectionLevel. We have a workflow where we can't store secrets in our packages but configure all our connection strings at runtime. T
The tricky part is debugging these packages in Visual Studio requires you to either exclude all packages you are not working on and manually setting ProtectionLevel on the working packaging and project, or the more cumbersome approach of setting ProtectionLevel on all packages every time. In a project with 20 packages like we have this is a chore. Anybody have any good workflow for debugging SSIS packages while maintining a DoNotSaveSensitive ProtectionLevel?
I would create Project Parameters to store the connection strings:
http://technet.microsoft.com/en-us/library/hh213214.aspx
Are you working in project deployment model?
https://msdn.microsoft.com/en-us/library/hh213290.aspx
It should just work this way.
All packages same level and you set the connection strings in the environment on the server. I deploy mine to prod with localhost connection using Windows auth and the server magically does the rest.
Can you just create a test project with just the package you want to test? Then you don't have to change protection level for each package.
The simple way is to have two projects in Visual Studio: one with DontSaveSensitive and another one with the protection level desired.
I have a SQL project in my .Net project in Visual Studio 2010. I added it to my solution because I thought it will help me to create all the database objects in more environment without difficulties.
My scope is to create/define the database objects (tables and stored procedures) in more computers, easily.For this purpose I created an Sql project in visual studio and I added for each table and stored procedure the creation script in this project. Now I have 30 scripts and I'd like to run it on a new sql instance.
If I open each sql file I have, in visual studio, an toolbat that allows me to tun the opened file on a sql instance (I have an connect button) and this generates the proper object (table or SP).
The question is: how do I do to run all the files in this project in one click. How to create all the objects in one click? Now I have about 30 scripts to run, and I need a proper way.
The way I tried to do it was to set as default project the sql project and to press run (F5), but then I got some strange compilation errors in sql files, errors witch didn't was there when I run (execute) each script individually.
Here is the right click menu for this project (No Run, Publish or something else!):
I tried to use from that menu the Deploy command. The bad news (for me) is that I got this on that command:
I don't have any error in my sql scripts, each one runs correctly.
Thank you.
Use need to deploy your project onto a database thus use the Deploy menu item.
The way database projects work, is that they compare the schema in the project to the schema at the destination.
What this means is you shouldn't have an use statements, or alter statements, ect...
What does one of those procs look like that is throwing the error?
I've currently got a set of reports with a number of common functions sitting in code blocks within the .rdl files. This obviously presents a maintainability issue and I as wondering if anyone knew a way for these different reports to share a library of common code?
Ideally I'd like to have a .Net Assembly attached to my Reporting Services project, which all of my reports can access and call functions from. This would save the headache of trying to update and redeploy about 100 reports every time a change needs to be made to a common function.
Any suggestions?
From within Visual Studio in the properties of the report, on the 'References' tab add the details for the assembly that contains the managed code. This code can be called from expressions within reports using the instance name that is specified.
This assembly can either be stored in the GAC or the PrivateAssemblies directory of Visual Studio, and be deployed to the Report Service 'bin' directory on the Reporting Services server. For more information refer to How to use custom assemblies or embedded code in Reporting Services
I had a lot of pain with this so I hope this helps someone. You can get it from the MSDN article but there are a few points below that I think can help speed someone through this a little faster.
Don't forget to add this to your rssrvpolicy.config file:
<CodeGroup class="UnionCodeGroup"
version="1"
PermissionSetName="FullTrust"
Name="MyCodeGroup"
Description="Code group for my data processing extension">
<IMembershipCondition class="UrlMembershipCondition"
version="1"
Url="C:\pathtocustomassembly\customassembly.dll"
/>
</CodeGroup>
I forgot to do this and I was hating it for awhile.
Plus don't forget to hit both of the following folders for 2005 with your new dll:
Program Files\Microsoft Visual Studio 8\Common7\IDE\PrivateAssemblies
Program Files\Microsoft SQL Server\MSSQL.3\Reporting Services\ReportServer\bin
Plus don't use log4net with your assembly. I couldn't make it work. Maybe someone can but not me.
Plus if you mess up like I did you won't be able to delete the files until you close Visual Studio.
Plus make your methods shared or static. It's easier.
Create a deployment batch file. Something like:
#ECHO OFF
REM Name: SRSDeploy_Local.bat
REM
REM This batch files copies my custom assembly to my Reporting Services folders.
REM
REM This is the SQL Server 2005 version:
copy "C:\Projects\Common\lib\SCI.Common.SSRSUtils.dll" "C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\PrivateAssemblies"
copy "C:\Projects\Common\lib\SCI.Common.SSRSUtils.dll" "C:\Program Files\Microsoft SQL Server\MSSQL.2\Reporting Services\ReportServer\bin"
Finally, build your report before previewing.
If it builds you're likely on your way.
Except...
You can't deploy it to your production report server because you'll always get the following error:
Error while loading code module
Which is what I'm working on right now.
The following article lists just about all the different ways of calling .Net code from an SSRS report. Extending Microsoft SQL Server 2000 Reporting Services with Custom Code
If all these reports run against the same server, another option to consider would be to use .Net stored procedures in the database to hold your code.
Many thanks guys, I can now call my assembly from my reports.
Supplementary question:
Is there a namespace I can include when I'm creating my assembly that makes it aware of objects in the report designer such as fields and parameters? It'd be really great if I could pass, say, a collection of fields in a strongly-typed way to my assembly.
And the answer: A couple of hours of searching reveals that adding \Program Files\Microsoft Visual Studio 8\Common7\IDE\PrivateAssemblies\Microsoft.ReportingServices.ProcessingObjectModel.dll as a reference in my assembly allows me to access the various Reporting Services types, such as Fields and Parameters. Note that in Reporting Services 2008, the namespace changes.
You must deploy to the GAC.
http://www.developerdotstar.com/community/node/333