<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="https://www.w3.org/2005/Atom" xmlns:sy="https://purl.org/rss/1.0/modules/syndication/" xmlns:dc="https://purl.org/dc/elements/1.1/" xmlns:content="https://purl.org/rss/1.0/modules/content/" xmlns:wfw="https://wellformedweb.org/CommentAPI/" xmlns:slash="https://purl.org/rss/1.0/modules/slash/"
  version="2.0">
  <channel>
    <title>A Seemingly Random Collection of SQL Server Stuff</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/bryan_c_smith/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/bryan_c_smith/feed.xml</link>
    <description />
    <lastBuildDate>Wed, 17 Apr 2019 03:39:59 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>Deploying Analysis Services Databases from BIDS</title>
      <link>https://docs.microsoft.com/archive/blogs/bryan_c_smith/deploying-analysis-services-databases-from-bids</link>
      <pubDate>Sun, 06 Sep 2009 00:47:00 GMT</pubDate>
      <dc:creator><![CDATA[Bryan C. Smith]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/bryan_c_smith/2009/09/06/deploying-analysis-services-databases-from-bids/</guid>
      <description><![CDATA[Once the developer is finished making changes to an Analysis Services project in Business...]]></description>
      <content:encoded><![CDATA[<P style="MARGIN: 0in 0in 10pt" class=MsoNormal><FONT size=3 face=Calibri>Once the developer is finished making changes to an Analysis Services project in Business Intelligence Development Studio (BIDS), he or she deploys the object definitions within the project to an Analysis Services instance. The deployment process, when performed through BIDS, takes place over four distinct steps:</FONT></P>
<P style="TEXT-INDENT: -0.25in; MARGIN: 0in 0in 0pt 0.5in; mso-list: l0 level1 lfo1" class=MsoListParagraphCxSpFirst><SPAN style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"><SPAN style="mso-list: Ignore"><FONT size=3 face=Calibri>1.</FONT><SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><FONT size=3 face=Calibri>Script building</FONT></P>
<P style="TEXT-INDENT: -0.25in; MARGIN: 0in 0in 0pt 0.5in; mso-list: l0 level1 lfo1" class=MsoListParagraphCxSpMiddle><SPAN style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"><SPAN style="mso-list: Ignore"><FONT size=3 face=Calibri>2.</FONT><SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><FONT size=3 face=Calibri>Object comparison</FONT></P>
<P style="TEXT-INDENT: -0.25in; MARGIN: 0in 0in 0pt 0.5in; mso-list: l0 level1 lfo1" class=MsoListParagraphCxSpMiddle><SPAN style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"><SPAN style="mso-list: Ignore"><FONT size=3 face=Calibri>3.</FONT><SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><FONT size=3 face=Calibri>Script submission</FONT></P>
<P style="TEXT-INDENT: -0.25in; MARGIN: 0in 0in 10pt 0.5in; mso-list: l0 level1 lfo1" class=MsoListParagraphCxSpLast><SPAN style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"><SPAN style="mso-list: Ignore"><FONT size=3 face=Calibri>4.</FONT><SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><FONT size=3 face=Calibri>Process protection</FONT></P>
<P style="MARGIN: 0in 0in 10pt 0.25in" class=MsoNormal><I style="mso-bidi-font-style: normal"><FONT face=Calibri><FONT size=3>Note These three steps are not what are formally described in the product documentation. Instead, Books Online refers to Build and Deploy processes with the Deploy process encompassing the Build process. To align the formal processes with these three steps, the script building step aligns to the Build process while the object comparison and script submission steps are the additional steps included in the Deploy process.<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></FONT></FONT></I></P>
<P style="MARGIN: 0in 0in 10pt" class=MsoNormal><FONT size=3 face=Calibri>During the first step, a series of XML files are assembled in the project’s Bin subfolder.<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>These files encapsulate the information within the project required for successfully deployment. Each is recognizable through the use of one of four file extensions:</FONT></P>
<P style="TEXT-INDENT: -0.25in; MARGIN: 0in 0in 0pt 0.5in; mso-list: l1 level1 lfo2" class=MsoListParagraphCxSpFirst><SPAN style="FONT-FAMILY: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol"><SPAN style="mso-list: Ignore"><FONT size=3>·</FONT><SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"><FONT face=Calibri><FONT size=3>.asdatabase<o:p></o:p></FONT></FONT></SPAN></P>
<P style="TEXT-INDENT: -0.25in; MARGIN: 0in 0in 0pt 0.5in; mso-list: l1 level1 lfo2" class=MsoListParagraphCxSpMiddle><SPAN style="FONT-FAMILY: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol"><SPAN style="mso-list: Ignore"><FONT size=3>·</FONT><SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"><FONT face=Calibri><FONT size=3>.configsettings<o:p></o:p></FONT></FONT></SPAN></P>
<P style="TEXT-INDENT: -0.25in; MARGIN: 0in 0in 0pt 0.5in; mso-list: l1 level1 lfo2" class=MsoListParagraphCxSpMiddle><SPAN style="FONT-FAMILY: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol"><SPAN style="mso-list: Ignore"><FONT size=3>·</FONT><SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"><FONT face=Calibri><FONT size=3>.deploymenttargets<o:p></o:p></FONT></FONT></SPAN></P>
<P style="TEXT-INDENT: -0.25in; MARGIN: 0in 0in 10pt 0.5in; mso-list: l1 level1 lfo2" class=MsoListParagraphCxSpLast><SPAN style="FONT-FAMILY: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol"><SPAN style="mso-list: Ignore"><FONT size=3>·</FONT><SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"><FONT size=3><FONT face=Calibri>.deploymentoptions<o:p></o:p></FONT></FONT></SPAN></P>
<P style="MARGIN: 0in 0in 10pt" class=MsoNormal><FONT size=3 face=Calibri>The .asdatabase file contains a ASSL script defining the database and all the objects within it. The script is assembled from the individual files of the Analysis Services project and serves as the basis for the script submitted to Analysis Services in the final step.</FONT></P>
<P style="MARGIN: 0in 0in 10pt" class=MsoNormal><FONT size=3 face=Calibri>The .configsettings file contains a listing of objects within the Analysis Services database as defined by the project associated with data storage as well as data sources. In deployments involving the Analysis Services Deployment Wizard, this file can be used to override certain information in the .asdatabase file.</FONT></P>
<P style="MARGIN: 0in 0in 10pt" class=MsoNormal><FONT size=3 face=Calibri>The .deploymenttargets file identifies the Analysis Services instance and database to which the script is to eventually be applied. <SPAN style="mso-spacerun: yes">&nbsp;</SPAN>The information in this file comes from database properties accessible within the Analysis Services project by opening the Solution Explorer window, right-clicking the database object, selecting properties, and navigating to the Deployment page.</FONT></P>
<P style="MARGIN: 0in 0in 10pt" class=MsoNormal><FONT size=3 face=Calibri>The .deploymentoptions file contains various settings controlling the deployment process. Some of these settings are accessible through the previously mentioned database properties dialog’s Deployment page.<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>Others are hardcoded for BIDS deployments.</FONT></P>
<P style="MARGIN: 0in 0in 10pt" class=MsoNormal><FONT size=3><FONT face=Calibri>To complete the script building step, a fifth file, LastBuilt.xml, is assembled. This file, located within the Obj subfolder associated with the project’s currently selected configuration. <SPAN style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin">This file records a timestamp and hash value for each object within the project. There is little to no documentation on the LastBuilt.xml file but it appears this information serves as the foundation of the following object comparison step.<o:p></o:p></SPAN></FONT></FONT></P>
<P style="MARGIN: 0in 0in 10pt 0.5in" class=MsoNormal><I style="mso-bidi-font-style: normal"><SPAN style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"><FONT size=3><FONT face=Calibri>Note The database properties dialog provides the means to select (and define) various configurations for your project.<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>Each configuration represents a collection of settings controlling aspects of the project environment as well as the deployment process. The default configuration for an Analysis Services project is Development so that the LastBuilt.xml file is often located in a subfolder called Development under the project’s Obj subfolder.<o:p></o:p></FONT></FONT></SPAN></I></P>
<P style="MARGIN: 0in 0in 10pt" class=MsoNormal><FONT size=3><FONT face=Calibri>With the script building step completed, the deployment process moves onto the object comparison step. During this step, a connection is made to the targeted Analysis Services instance and a Discover statement submitted to retrieve the <SPAN style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin">name, id, and timestamp associated with various database objects. The values returned are compared to the information in the LastBuilt.xml file to determine which changes need to be pushed to the Analysis Services instance.<o:p></o:p></SPAN></FONT></FONT></P>
<P style="MARGIN: 0in 0in 10pt" class=MsoNormal><FONT size=3 face=Calibri>Following this determination the process moves into the script submission step. An XMLA Alter statement based on information in the .asdatabase, .configsettings, and .deploymentoptions is assembled and submitted to the Analysis Services database. </FONT></P>
<P style="MARGIN: 0in 0in 10pt" class=MsoNormal><FONT size=3 face=Calibri>Once the changes have been deployed, the Discover statement issued during the object comparison step is resubmitted. The results of that statement are combined with information from the deployment process to construct a final file, IncrementalShapshot.xml <I style="mso-bidi-font-style: normal">[sic]</I>, which is stored side-by-side with the LastBuilt.xml file. The purpose of this file appears to be to assist the next deployment cycle in determining whether a database has been altered outside of the confines of the current project. (If this is the case, this file is likely employed during the object comparison step.)</FONT></P>]]></content:encoded>
    </item>
    <item>
      <title>Firing a Reporting Services Subscription from an Integration Services Package</title>
      <link>https://docs.microsoft.com/archive/blogs/bryan_c_smith/firing-a-reporting-services-subscription-from-an-integration-services-package</link>
      <pubDate>Thu, 03 Sep 2009 12:55:00 GMT</pubDate>
      <dc:creator><![CDATA[Bryan C. Smith]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/bryan_c_smith/2009/09/03/firing-a-reporting-services-subscription-from-an-integration-services-package/</guid>
      <description><![CDATA[I am working with a customer who needs to trigger the subscriptions associated with a Reporting...]]></description>
      <content:encoded><![CDATA[<P style="MARGIN: 0in 0in 10pt" class=MsoNormal><FONT size=3 face=Calibri>I am working with a customer who needs to trigger the subscriptions associated with a Reporting Services report just after the SSIS package responsible for refreshing the data behind the report completes its run.<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>Since the customer is already working with SSIS, I figured using a Script task to call the Reporting Services web service’s FireEvent method might be the easiest way to go about this. The following are the high-level steps I performed to demonstrate this approach to the customer.</FONT></P>
<P style="MARGIN: 0in 0in 10pt 0.5in" class=MsoNormal><I style="mso-bidi-font-style: normal"><FONT size=3><FONT face=Calibri>Note For the purposes of the demonstration, I am working with Reporting Services 2008 SP1 running in Native mode on my local system. In Reporting Services, I am a member of the System Administrator server role and a Content Manager in the Home directory.<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></FONT></FONT></I></P>
<P style="MARGIN: 0in 0in 10pt" class=MsoNormal><FONT size=3 face=Calibri>The first step is to create a subscription associated with a report.<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>This subscription should never run on its own so you’ll assign it a run-once schedule set to end on a date in the past.</FONT></P>
<P style="MARGIN: 0in 0in 10pt" class=MsoNormal><FONT size=3 face=Calibri>In my demo, I’m using a report-specific schedule.<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>I’ve read a blog suggesting the use of a shared schedule but my concern is that when I fire the event in my code, any subscription tied to that schedule will run.<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>You can use either type of schedule just be aware of the consequences.</FONT></P>
<P style="TEXT-INDENT: -0.25in; MARGIN: 0in 0in 0pt 0.5in; mso-list: l2 level1 lfo1" class=MsoListParagraphCxSpFirst><SPAN style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"><SPAN style="mso-list: Ignore"><FONT size=3 face=Calibri>1.</FONT><SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><FONT size=3 face=Calibri>Open Report Manager and locate the report. In my demonstration, this is a report called Blank Report in the Demo Reports folder located under Home.</FONT></P>
<P style="TEXT-INDENT: -0.25in; MARGIN: 0in 0in 0pt 0.5in; mso-list: l2 level1 lfo1" class=MsoListParagraphCxSpMiddle><SPAN style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"><SPAN style="mso-list: Ignore"><FONT size=3 face=Calibri>2.</FONT><SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><FONT size=3 face=Calibri>Setup subscription with a subscription-specific schedule set to run once with a start and end date set to a day in the past.</FONT></P>
<P style="MARGIN: 0in 0in 10pt 0.5in" class=MsoListParagraphCxSpLast><SPAN style="mso-no-proof: yes"><FONT size=3><FONT face=Calibri><?xml:namespace prefix = v ns = "urn:schemas-microsoft-com:vml" /><v:shapetype id=_x0000_t75 coordsize="21600,21600" o:spt="75" o:preferrelative="t" path="m@4@5l@4@11@9@11@9@5xe" filled="f" stroked="f"><v:stroke joinstyle="miter"></v:stroke><v:formulas><v:f eqn="if lineDrawn pixelLineWidth 0"></v:f><v:f eqn="sum @0 1 0"></v:f><v:f eqn="sum 0 0 @1"></v:f><v:f eqn="prod @2 1 2"></v:f><v:f eqn="prod @3 21600 pixelWidth"></v:f><v:f eqn="prod @3 21600 pixelHeight"></v:f><v:f eqn="sum @0 0 1"></v:f><v:f eqn="prod @6 1 2"></v:f><v:f eqn="prod @7 21600 pixelWidth"></v:f><v:f eqn="sum @8 21600 0"></v:f><v:f eqn="prod @7 21600 pixelHeight"></v:f><v:f eqn="sum @10 21600 0"></v:f></v:formulas><v:path o:extrusionok="f" gradientshapeok="t" o:connecttype="rect"></v:path><o:lock v:ext="edit" aspectratio="t"></o:lock></v:shapetype><v:shape style="WIDTH: 354.75pt; HEIGHT: 372.75pt; VISIBILITY: visible; mso-wrap-style: square" id=Picture_x0020_19 o:spid="_x0000_i1027" type="#_x0000_t75"><v:imagedata mce_src="file:///C:\Users\brysmi\AppData\Local\Temp\msohtmlclip1\01\clip_image001.png" src="file:///C:\Users\brysmi\AppData\Local\Temp\msohtmlclip1\01\clip_image001.png" o:title=""></v:imagedata></v:shape></FONT></FONT></SPAN></P>
<P style="MARGIN: 0in 0in 10pt" class=MsoNormal><FONT size=3 face=Calibri>Next, you need to assign the permissions required to call the FireEvent method. In my local instance of Reporting Services, I am a member of the System Administrator server role but even this role doesn’t have the required permission by default. </FONT></P>
<P style="MARGIN: 0in 0in 10pt" class=MsoNormal><FONT size=3 face=Calibri>To assign the permission you have two options, you can modify an existing server role or create a new one.<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>To keep my system standard, I created a new one with just that permission and then assign myself membership in that new server role:</FONT></P>
<P style="TEXT-INDENT: -0.25in; MARGIN: 0in 0in 0pt 0.5in; mso-list: l1 level1 lfo2" class=MsoListParagraphCxSpFirst><SPAN style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"><SPAN style="mso-list: Ignore"><FONT size=3 face=Calibri>1.</FONT><SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><FONT size=3 face=Calibri>Open SQL Server Management Studio and connect to your instance of Reporting Services.</FONT></P>
<P style="TEXT-INDENT: -0.25in; MARGIN: 0in 0in 0pt 0.5in; mso-list: l1 level1 lfo2" class=MsoListParagraphCxSpMiddle><SPAN style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"><SPAN style="mso-list: Ignore"><FONT size=3 face=Calibri>2.</FONT><SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><FONT size=3 face=Calibri>Expand the Security folder, right-click the Server Roles child folder, and select New Server Role to launch the New Server Role dialog.</FONT></P>
<P style="TEXT-INDENT: -0.25in; MARGIN: 0in 0in 0pt 0.5in; mso-list: l1 level1 lfo2" class=MsoListParagraphCxSpMiddle><SPAN style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"><SPAN style="mso-list: Ignore"><FONT size=3 face=Calibri>3.</FONT><SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><FONT size=3 face=Calibri>Assign the role an appropriate name (and description) and select the Generate events task.</FONT></P>
<P style="MARGIN: 0in 0in 0pt 0.5in" class=MsoListParagraphCxSpMiddle><SPAN style="mso-no-proof: yes"><v:shape style="WIDTH: 309.75pt; HEIGHT: 278.25pt; VISIBILITY: visible; mso-wrap-style: square" id=Picture_x0020_25 o:spid="_x0000_i1026" type="#_x0000_t75"><v:imagedata mce_src="file:///C:\Users\brysmi\AppData\Local\Temp\msohtmlclip1\01\clip_image003.png" src="file:///C:\Users\brysmi\AppData\Local\Temp\msohtmlclip1\01\clip_image003.png" o:title=""><FONT size=3 face=Calibri></FONT></v:imagedata></v:shape></SPAN></P>
<P style="TEXT-INDENT: -0.25in; MARGIN: 0in 0in 0pt 0.5in; mso-list: l1 level1 lfo2" class=MsoListParagraphCxSpMiddle><SPAN style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"><SPAN style="mso-list: Ignore"><FONT size=3 face=Calibri>4.</FONT><SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><FONT size=3 face=Calibri>Click OK to create the role and close the dialog.</FONT></P>
<P style="TEXT-INDENT: -0.25in; MARGIN: 0in 0in 0pt 0.5in; mso-list: l1 level1 lfo2" class=MsoListParagraphCxSpMiddle><SPAN style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"><SPAN style="mso-list: Ignore"><FONT size=3 face=Calibri>5.</FONT><SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><FONT size=3 face=Calibri>Return to Report Manager.</FONT></P>
<P style="TEXT-INDENT: -0.25in; MARGIN: 0in 0in 0pt 0.5in; mso-list: l1 level1 lfo2" class=MsoListParagraphCxSpMiddle><SPAN style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"><SPAN style="mso-list: Ignore"><FONT size=3 face=Calibri>6.</FONT><SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><FONT size=3 face=Calibri>Open Site Settings and then the Security page.</FONT></P>
<P style="TEXT-INDENT: -0.25in; MARGIN: 0in 0in 10pt 0.5in; mso-list: l1 level1 lfo2" class=MsoListParagraphCxSpLast><SPAN style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"><SPAN style="mso-list: Ignore"><FONT size=3 face=Calibri>7.</FONT><SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><FONT size=3 face=Calibri>Assign yourself membership in your new server role.</FONT></P>
<P style="MARGIN: 0in 0in 10pt" class=MsoNormal><FONT size=3 face=Calibri>With the subscription and security in place, now it’s time to start programming.<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>As I said earlier, the customer’s goal is to tie this all into an ETL layer that’s written using SQL Server Integration Services. So, for this demonstration, I create a package, add a script task, and enter the required code:</FONT></P>
<P style="TEXT-INDENT: -0.25in; MARGIN: 0in 0in 0pt 0.5in; mso-list: l0 level1 lfo3" class=MsoListParagraphCxSpFirst><SPAN style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"><SPAN style="mso-list: Ignore"><FONT size=3 face=Calibri>1.</FONT><SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><FONT size=3 face=Calibri>Launch the SQL Server Business Intelligence Development Studio and create a new Integration Services package.</FONT></P>
<P style="TEXT-INDENT: -0.25in; MARGIN: 0in 0in 0pt 0.5in; mso-list: l0 level1 lfo3" class=MsoListParagraphCxSpMiddle><SPAN style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"><SPAN style="mso-list: Ignore"><FONT size=3 face=Calibri>2.</FONT><SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><FONT size=3 face=Calibri>Drag a Script task from the toolbar to the control flow.</FONT></P>
<P style="TEXT-INDENT: -0.25in; MARGIN: 0in 0in 0pt 0.5in; mso-list: l0 level1 lfo3" class=MsoListParagraphCxSpMiddle><SPAN style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"><SPAN style="mso-list: Ignore"><FONT size=3 face=Calibri>3.</FONT><SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><FONT size=3 face=Calibri>Open the Script task, select an appropriate language—VB.NET in my example—and then click the Edit Script… button to launch the Visual Studio Tools for Applications environment.</FONT></P>
<P style="TEXT-INDENT: -0.25in; MARGIN: 0in 0in 0pt 0.5in; mso-list: l0 level1 lfo3" class=MsoListParagraphCxSpMiddle><SPAN style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"><SPAN style="mso-list: Ignore"><FONT size=3 face=Calibri>4.</FONT><SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><FONT size=3 face=Calibri>From the Project menu, select Add Web Reference to launch the Add Web Reference dialog.</FONT></P>
<P style="TEXT-INDENT: -0.25in; MARGIN: 0in 0in 0pt 0.5in; mso-list: l0 level1 lfo3" class=MsoListParagraphCxSpMiddle><SPAN style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"><SPAN style="mso-list: Ignore"><FONT size=3 face=Calibri>5.</FONT><SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><FONT size=3 face=Calibri>For the URL, enter the path to Reporting Services web service’s ReportService2005 endpoint.<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>On my local system, this is </FONT><A href="https://localhost/reportserver/reportservice2005.asmx?wsdl" mce_href="https://localhost/reportserver/reportservice2005.asmx?wsdl"><FONT color=#0000ff size=3 face=Calibri>https://localhost/reportserver/reportservice2005.asmx?wsdl</FONT></A><FONT size=3 face=Calibri>. </FONT></P>
<P style="TEXT-INDENT: -0.25in; MARGIN: 0in 0in 0pt 0.5in; mso-list: l0 level1 lfo3" class=MsoListParagraphCxSpMiddle><SPAN style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"><SPAN style="mso-list: Ignore"><FONT size=3 face=Calibri>6.</FONT><SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><FONT size=3 face=Calibri>Clicking Go retrieves the metadata for the web service endpoint which populates the dialog. Modify the web reference name as appropriate – I chose rs for my web reference name—and then click Add Reference to add the reference to your project.</FONT></P>
<P style="MARGIN: 0in 0in 0pt 0.5in" class=MsoListParagraphCxSpMiddle><SPAN style="mso-no-proof: yes"><v:shape style="WIDTH: 354.75pt; HEIGHT: 246.75pt; VISIBILITY: visible; mso-wrap-style: square" id=Picture_x0020_16 o:spid="_x0000_i1025" type="#_x0000_t75"><v:imagedata mce_src="file:///C:\Users\brysmi\AppData\Local\Temp\msohtmlclip1\01\clip_image005.png" src="file:///C:\Users\brysmi\AppData\Local\Temp\msohtmlclip1\01\clip_image005.png" o:title=""><FONT size=3 face=Calibri></FONT></v:imagedata></v:shape></SPAN></P>
<P style="TEXT-INDENT: -0.25in; MARGIN: 0in 0in 10pt 0.5in; mso-list: l0 level1 lfo3" class=MsoListParagraphCxSpLast><SPAN style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"><SPAN style="mso-list: Ignore"><FONT size=3 face=Calibri>7.</FONT><SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><FONT size=3 face=Calibri>With the web reference in place, you can now enter your code.<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>For my demonstration, I modified Sub Main as follows:</FONT></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt 0.25in; mso-layout-grid-align: none" class=MsoNormal><SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">Public</SPAN> <SPAN style="COLOR: blue">Sub</SPAN> Main()<o:p></o:p></SPAN></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt 0.25in; mso-layout-grid-align: none" class=MsoNormal><SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"><o:p>&nbsp;</o:p></SPAN></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt 0.25in; mso-layout-grid-align: none" class=MsoNormal><SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: blue">Dim</SPAN> MyRs <SPAN style="COLOR: blue">As</SPAN> <SPAN style="COLOR: blue">New</SPAN> rs.ReportingService2005()<o:p></o:p></SPAN></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt 0.25in; mso-layout-grid-align: none" class=MsoNormal><SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN>MyRs.Credentials = System.Net.CredentialCache.DefaultCredentials<o:p></o:p></SPAN></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt 0.25in; mso-layout-grid-align: none" class=MsoNormal><SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"><o:p>&nbsp;</o:p></SPAN></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt 0.25in; mso-layout-grid-align: none" class=MsoNormal><SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: blue">Dim</SPAN> MySubs <SPAN style="COLOR: blue">As</SPAN> rs.Subscription() = _<o:p></o:p></SPAN></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt 0.25in; mso-layout-grid-align: none" class=MsoNormal><SPAN style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN></SPAN><SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes">MyRs.ListSubscriptions(<SPAN style="COLOR: #a31515">"/Demo Reports/Blank Report"</SPAN>, <SPAN style="COLOR: blue">Nothing</SPAN>)<o:p></o:p></SPAN></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt 0.25in; mso-layout-grid-align: none" class=MsoNormal><SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"><o:p>&nbsp;</o:p></SPAN></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt 0.25in; mso-layout-grid-align: none" class=MsoNormal><SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: blue">Dim</SPAN> MySub <SPAN style="COLOR: blue">As</SPAN> rs.Subscription = MySubs(0)<o:p></o:p></SPAN></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt 0.25in; mso-layout-grid-align: none" class=MsoNormal><SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN>MyRs.FireEvent(MySub.EventType, MySub.SubscriptionID)<o:p></o:p></SPAN></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt 0.25in; mso-layout-grid-align: none" class=MsoNormal><SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"><o:p>&nbsp;</o:p></SPAN></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt 0.25in; mso-layout-grid-align: none" class=MsoNormal><SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"><o:p>&nbsp;&nbsp;</o:p></SPAN><SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;</SPAN>Dts.TaskResult = ScriptResults.Success<o:p></o:p></SPAN></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt 0.25in; mso-layout-grid-align: none" class=MsoNormal><SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"><o:p>&nbsp;</o:p></SPAN></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt 0.25in; mso-layout-grid-align: none" class=MsoNormal><SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: blue">End</SPAN> <SPAN style="COLOR: blue">Sub</SPAN></SPAN></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt 0.25in; mso-layout-grid-align: none" class=MsoNormal><SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"><SPAN style="COLOR: blue"></SPAN></SPAN><SPAN style="COLOR: blue; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-no-proof: yes"><o:p></o:p></SPAN>&nbsp;</P>
<P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class=MsoNormal><SPAN style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-no-proof: yes"><FONT size=3><FONT face=Calibri>Let me pick apart this code a bit.<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>I first declare a new object, MyRs, which represents the web service interface.<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>I establish my identity with the interface leveraging my active Windows credentials. <o:p></o:p></FONT></FONT></SPAN></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class=MsoNormal><SPAN style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-no-proof: yes"><o:p><FONT size=3 face=Calibri>&nbsp;</FONT></o:p></SPAN></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class=MsoNormal><SPAN style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-no-proof: yes"><FONT size=3><FONT face=Calibri><SPAN style="mso-spacerun: yes">&nbsp;</SPAN>Then I open the collection of subscriptions associated with my report, /Demo Reports/Blank Report. I then grab the one subscription tied to my report and fire the event associated with it before completing the routine.<o:p></o:p></FONT></FONT></SPAN></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class=MsoNormal><SPAN style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-no-proof: yes"><o:p><FONT size=3 face=Calibri>&nbsp;</FONT></o:p></SPAN></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class=MsoNormal><SPAN style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-no-proof: yes"><FONT size=3><FONT face=Calibri>So, how do I know the subscription I want is the one with an index of 0 in the subscriptions collection?<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>Well, in my example, there is only one subscription.<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>In the real world, you’ll need to look at the subscription’s properties or some other mechanism to determine which one to fire.<o:p></o:p></FONT></FONT></SPAN></P>]]></content:encoded>
    </item>
  </channel>
</rss>