<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://sqlblog.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Search results matching tags 'SQL Server 2012' and 'Parameters'</title><link>http://sqlblog.com/search/SearchResults.aspx?o=DateDescending&amp;tag=SQL+Server+2012,Parameters&amp;orTags=0</link><description>Search results matching tags 'SQL Server 2012' and 'Parameters'</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP2 (Build: 61129.1)</generator><item><title>Required Parameters [SSIS Denali]</title><link>http://sqlblog.com/blogs/jamie_thomson/archive/2010/12/20/required-parameters-ssis-denali.aspx</link><pubDate>Mon, 20 Dec 2010 17:35:10 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:31795</guid><dc:creator>jamiet</dc:creator><description>&lt;p&gt;SQL Server Integration Services (SSIS) in its 2005 and 2008 incarnations expects you to set a property values within your package at runtime using Configurations. SSIS developers tend to have rather a lot of issues with SSIS configurations; in this blog post I am going to highlight one of those problems and how it has been alleviated in SQL Server code-named Denali.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;A configuration is a property path/value pair that exists outside of a package, typically within SQL Server or in a collection of one or more configurations in a file called a .dtsConfig file. Within the package one defines a pointer to a configuration that says to the package “When you execute, go and get a configuration value from this location” and if all goes well the package will fetch that configuration value as it starts to execute and you will see something like the following in your output log:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;font face="Consolas"&gt;Information: 0x40016041 at Package: The package is attempting to configure from the XML file &amp;quot;C:\Configs\MyConfig.dtsConfig&amp;quot;.&lt;/font&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Unfortunately things DON’T always go well, perhaps the .dtsConfig file is unreachable or the name of the SQL Sever holding the configuration value has been defined incorrectly – any one of a number of things can go wrong. In this circumstance you might see something like the following in your log output instead:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;font face="Consolas"&gt;Warning: 0x80012014 at Package: The configuration file &amp;quot;C:\Configs\MyConfig.dtsConfig&amp;quot; cannot be found. Check the directory and file name.&lt;/font&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;The problem that I want to draw attention to here though is that &lt;em&gt;&lt;strong&gt;your package will ignore the fact it can’t find the configuration and executes anyway&lt;/strong&gt;&lt;/em&gt;. This is really really bad because the package will not be doing what it is supposed to do and worse, if you have not isolated your environments you might not even know about it. Can you imagine a package executing for months and all the while inserting data into the wrong server? Sounds ridiculous but I have absolutely seen this happen and the root cause was that no-one picked up on configuration warnings like the one above.&lt;/p&gt;  &lt;p&gt;Happily in SSIS code-named Denali this problem has gone away as configurations have been replaced with &lt;a href="http://sqlblog.com/blogs/jamie_thomson/archive/2010/11/11/parameters-in-ssis-in-denali.aspx"&gt;parameters&lt;/a&gt;. Each parameter has a property called ‘Required’:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://sqlblog.com/blogs/jamie_thomson/image_1E13F054.png"&gt;&lt;img style="background-image:none;border-bottom:0px;border-left:0px;margin:;padding-left:0px;padding-right:0px;display:inline;border-top:0px;border-right:0px;padding-top:0px;" title="image" border="0" alt="image" src="http://sqlblog.com/blogs/jamie_thomson/image_thumb_2D675263.png" width="543" height="107" /&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Any parameter with Required=True must have a value passed to it when the package executes. Any attempt to execute the package will result in an error. Here we see that error when attempting to execute using the SSMS UI:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://sqlblog.com/blogs/jamie_thomson/image_65399686.png"&gt;&lt;img style="background-image:none;border-bottom:0px;border-left:0px;margin:;padding-left:0px;padding-right:0px;display:inline;border-top:0px;border-right:0px;padding-top:0px;" title="image" border="0" alt="image" src="http://sqlblog.com/blogs/jamie_thomson/image_thumb_6AA8072A.png" width="685" height="464" /&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;and similarly when executing using T-SQL:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://sqlblog.com/blogs/jamie_thomson/image_5AB8C266.png"&gt;&lt;img style="background-image:none;border-bottom:0px;border-left:0px;margin:;padding-left:0px;padding-right:0px;display:inline;border-top:0px;border-right:0px;padding-top:0px;" title="image" border="0" alt="image" src="http://sqlblog.com/blogs/jamie_thomson/image_thumb_59742987.png" width="754" height="335" /&gt;&lt;/a&gt;&lt;/p&gt;    &lt;p&gt;Error is:&lt;/p&gt;    &lt;p&gt;&lt;font color="#ff0000"&gt;Msg 27184, Level 16, State 1, Procedure prepare_execution, Line 112       &lt;br /&gt;In order to execute this package, you need to specify values for the required parameters.        &lt;br /&gt;&lt;/font&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;        &lt;p&gt;As you can see, SSIS code-named Denali has mechanisms built-in to prevent the problem I described at the top of this blog post. Specifying a Parameter required means that any packages in that project &lt;strong&gt;&lt;em&gt;cannot execute until a value for the parameter has been supplied&lt;/em&gt;&lt;/strong&gt;. This is a very good thing.&lt;/p&gt;  &lt;p&gt;I am loathe to make recommendations so early in the development cycle but right now I’m thinking that all Project Parameters should have Required=True, certainly any that are used to define external locations should be anyway.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://twitter.com/jamiet"&gt;@Jamiet&lt;/a&gt;&lt;/p&gt;</description></item><item><title>Parameters in SSIS in Denali</title><link>http://sqlblog.com/blogs/jamie_thomson/archive/2010/11/11/parameters-in-ssis-in-denali.aspx</link><pubDate>Thu, 11 Nov 2010 19:58:00 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:30436</guid><dc:creator>jamiet</dc:creator><description>&lt;p&gt;In my last blog post &lt;a target="_blank" href="http://sqlblog.com/blogs/jamie_thomson/archive/2010/11/10/introduction-to-ssis-projects-in-denali.aspx"&gt;Introduction to SSIS Projects in Denali&lt;/a&gt; I talked about the new Project deployment model that is coming in the next version of SQL Server Integration Services (SSIS); working hand-in-hand with Projects is another new feature – Parameters. Parameters are similar to Variables in SSIS today that we all know and (ahem) love but with one important difference – they are fundamental to how SSIS will manage and execute packages inside a SSIS Catalog (we’ll get onto those later) and hence have some subtle differences to Variables. Moreover (this should please a lot of you), &lt;b&gt;parameters are the replacement for configurations&lt;/b&gt; that are in the current version of SSIS (i.e. SSIS2008).&lt;/p&gt;  &lt;p&gt;There are two types of parameters:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Project parameters &lt;/li&gt;    &lt;li&gt;Package parameters &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;I’ll be covering both herein.&lt;/p&gt;  &lt;p&gt;First there is a little bit of terminology to be grasped in regard to parameters. As with all terminology please learn these and use them appropriately:&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;&lt;b&gt;Design Default: &lt;/b&gt;The value that gets set for a parameter at design-time &lt;/li&gt;    &lt;li&gt;&lt;b&gt;Server Default: &lt;/b&gt;Optional new default value that is applied to the parameter when it is deployed to a catalog. &lt;/li&gt;    &lt;li&gt;&lt;b&gt;Execution Parameter Value:&lt;/b&gt; Effectively an override for the Server default that you set when the package is executed &lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;There are a few more things to know about Parameters in regard to Catalogs and Environments (another new term) but as I haven’t talked about Environments yet I’ll save that for later.&lt;/p&gt;  &lt;p&gt;Parameters can be read from and written to inside a package and by implication they can also be referenced by any task in those packages. References will be in an expression just as is the case with Variables, they just happen to have a slightly different syntax as shown here:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://sqlblog.com/blogs/jamie_thomson/image_0B072546.png"&gt;&lt;img style="background-image:none;border-bottom:0px;border-left:0px;margin:;padding-left:0px;padding-right:0px;display:inline;border-top:0px;border-right:0px;padding-top:0px;" title="image" border="0" alt="image" width="575" height="508" src="http://sqlblog.com/blogs/jamie_thomson/image_thumb_1AC6BA4A.png"&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Simply a prefix of either $Project or $Package (as appropriate) can be applied to a parameter name to reference it in an expression. I have highlighted a Package Parameter and two Project Parameters available in the familiar Expression Builder in the screenshot above.&lt;/p&gt;  &lt;h1&gt;Project Parameters&lt;/h1&gt;  &lt;p&gt;As I said above Parameters are very similar to Variables but in the case of &lt;i&gt;Project &lt;/i&gt;Parameters there is one very important characteristic that distinguishes them - &lt;b&gt;instead of being scoped to a package they are scoped to a &lt;i&gt;Project&lt;/i&gt; and any package within that project can access them&lt;/b&gt;. (This is why its important to have a good grasp of SSIS Projects before being introduced to Parameters and hence why my first post in this series was &lt;a target="_blank" href="http://sqlblog.com/blogs/jamie_thomson/archive/2010/11/10/introduction-to-ssis-projects-in-denali.aspx"&gt;Introduction to SSIS Projects in Denali&lt;/a&gt;). With that in mind let’s take a closer look at Project Parameters. &lt;/p&gt;  &lt;p&gt;Right-clicking on a project in Solution Explorer will offer the option to display the parameters of that project:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://sqlblog.com/blogs/jamie_thomson/image_267C017C.png"&gt;&lt;img style="background-image:none;border-right-width:0px;margin:;padding-left:0px;padding-right:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;padding-top:0px;" title="image" border="0" alt="image" width="439" height="180" src="http://sqlblog.com/blogs/jamie_thomson/image_thumb_507BFFA4.png"&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;selecting that option displays the Project Parameters pane:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://sqlblog.com/blogs/jamie_thomson/image_4AFD6933.png"&gt;&lt;img style="background-image:none;border-right-width:0px;margin:;padding-left:0px;padding-right:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;padding-top:0px;" title="image" border="0" alt="image" width="566" height="117" src="http://sqlblog.com/blogs/jamie_thomson/image_thumb_22EABA14.png"&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;In the example shown here I have a CustomerId parameter that can be accessed by any package within the project.&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;b&gt;Scope&lt;/b&gt;, in the case of Project Parameters, is always “Project”'&lt;/li&gt;    &lt;li&gt;&lt;b&gt;Data Type &lt;/b&gt;is, hopefully, self-explanatory&lt;/li&gt;    &lt;li&gt;&lt;b&gt;Default Value&lt;/b&gt;&lt;u&gt; &lt;/u&gt;is the &lt;b&gt;Design Default&lt;/b&gt; that I mentioned earlier&lt;/li&gt;    &lt;li&gt;Setting &lt;b&gt;Sensitive on server &lt;/b&gt;to TRUE will ensure that the the value in the parameter gets encrypted when it is deployed to a SSIS catalog (important for secure credentials)&lt;/li&gt;    &lt;li&gt;Setting &lt;b&gt;Required&lt;/b&gt;&lt;u&gt; &lt;/u&gt;to TRUE means that after the project is deployed a &lt;b&gt;Server Default &lt;/b&gt;or &lt;b&gt;Execution Parameter Value&lt;/b&gt; must be supplied.&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;The ability to be accessed across multiple packages in a project is important. SSIS developers today will be well used to various mechanisms to using a value in multiple packages; Parent Package Configurations are a common option as is referencing the same configuration file from multiple packages although, judging by the amount of posts on the &lt;a target="_blank" href="http://social.msdn.microsoft.com/Forums/en-US/sqlintegrationservices/threads"&gt;SSIS forum&lt;/a&gt;, neither of these options are particularly well-liked amongst the SSIS fraternity. &lt;i&gt;Writing &lt;/i&gt;to a Variable from multiple packages is even more difficult, indeed sometimes the only way to do it means &lt;a target="_blank" href="http://consultingblogs.emc.com/jamiethomson/archive/2005/03/17/1151.aspx"&gt;resorting to writing script code&lt;/a&gt; – not quick and easy at all. Project Parameters change all that because they are defined &lt;i&gt;outside&lt;/i&gt; of a package hence can be accessed by any package within the Project and this makes them ideal for storing such things as database connection strings. its not hard to see why they are going to be a great replacement for configurations.&lt;/p&gt;  &lt;h1&gt;Package Parameters&lt;/h1&gt;  &lt;p&gt;Pretty much everything I just said about Project Parameters applies to Package Parameters except for one important difference and that is implied by the name – they are scoped to a Package rather than a Project. If you’re now asking yourself “What’s the difference between Package Parameters and package-scoped Variables?” then you’re not alone, I was asking myself the same thing. Aside from what I already said about Project Parameters (able to be referenced inside a Catalog etc…) the distinguishing characteristic (and what makes them useful) as far as I can discern is that they can be referenced from an Execute Package Task thus solving the problems that I outlined in my Connect submission &lt;a target="_blank" href="https://connect.microsoft.com/SQLServer/feedback/details/295885/ssis-execute-package-task-should-support-parameters"&gt;Execute Package Task should support parameters&lt;/a&gt; – indeed someone from the SSIS team replied to that submission by saying:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;i&gt;We have introduced parameters in upcoming release, and parent package will be able to use parent parameters to set the child package parameter values. Child package will also be able to run on its own. Hopefully this will address most of the issues described in this bug. &lt;/i&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;For folks that don’t want to move to the new deployment model (which isn’t a pre-requisite to using SSIS in Denali by the way) the ability to parameterize the Execute Package Task is a great new feature. More on the new Execute Package Task in a later blog post.&lt;/p&gt;  &lt;p&gt;&amp;nbsp;&lt;/p&gt;  &lt;p&gt;I think I have exhausted SSIS Parameters for now. In this blog post I introduced some terminology that I haven’t covered yet, namely Catalogs and Environments. I’ll cover those in a later blog post.&lt;/p&gt;        &lt;p&gt;&lt;a href="http://twitter.com/jamiet"&gt;@Jamiet&lt;/a&gt;&lt;/p&gt;&lt;p&gt;UPDATE: I want to make a clarification about a statement I said above that some people may have misinterpreted. Configurations as you know them today are not going away -they are fully supported in Denali- now though you have the option to use parameters instead. So, for those of you that may be fretting that your existing SSIS implementations will not work in Denali, fear not - barring any other unforeseen mishaps they should continue to work just fine.&lt;/p&gt;</description></item></channel></rss>