<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Shristi on Medium]]></title>
        <description><![CDATA[Stories by Shristi on Medium]]></description>
        <link>https://medium.com/@shristi08?source=rss-72c010bf5f7d------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*92JKngUuNC9GgNdh.jpg</url>
            <title>Stories by Shristi on Medium</title>
            <link>https://medium.com/@shristi08?source=rss-72c010bf5f7d------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 02 Dec 2026 00:21:34 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@shristi08/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Power BI Data modeling]]></title>
            <link>https://shristi08.medium.com/power-bi-data-modeling-eac1ee966f80?source=rss-72c010bf5f7d------2</link>
            <guid isPermaLink="false">https://medium.com/p/eac1ee966f80</guid>
            <category><![CDATA[bi]]></category>
            <category><![CDATA[power-bi]]></category>
            <category><![CDATA[data-modeling]]></category>
            <dc:creator><![CDATA[Shristi]]></dc:creator>
            <pubDate>Thu, 27 Aug 2020 14:57:43 GMT</pubDate>
            <atom:updated>2020-08-27T14:57:43.579Z</atom:updated>
            <content:encoded><![CDATA[<p>Data modeling is done to define relationship among the tables to represent the group of tables into Data model</p><p>The data has to model to prepare an in-depth report</p><p>The best way to prepare a report is to use tables with a defined relationship if you use a single table the interactives of the report may reduce data modeling is nothing but arranging the fact tables and dimension tables</p><p>Fact tables are defining the business process while the dimension tables answer the question like when, what, how, where, when.</p><p>The fact tables have a large number of attributes which is data while dimension tables are a small number of attribute</p><p>The fact tables have data in the form of numbers whereas the dimension tables have a string that defines place name etc.</p><p>Whereof dimension tables are answered by time table or Calendar table which defines dates, days, year in a certain interval of time required</p><p>When you are load data from the source make sure you remove unwanted columns out of tables</p><p>TO CREATE A DATA MODEL</p><p>Step 1: To determine the fact tables and the dimension tables in your database if you are just getting started then should begin with one fact table and two or more attributes</p><p>Step 2:Then define the relationship among them do not complicate at the start</p><p>for example, in the below image you can see a database diagram which as one fact table which is connect with different dimension table</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2Fr41ToMMC1sIN82WQDc3A.png" /><figcaption>Data Model</figcaption></figure><p>Step 3: Then for making a report use the measures and create a basic report once done with the basic report you can start adding more dimension tables, fact tables, and complex measures</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=eac1ee966f80" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[SQL Correlated Subqueries]]></title>
            <link>https://shristi08.medium.com/sql-correlated-subqueries-e271ef552f87?source=rss-72c010bf5f7d------2</link>
            <guid isPermaLink="false">https://medium.com/p/e271ef552f87</guid>
            <category><![CDATA[correlated-subquery]]></category>
            <dc:creator><![CDATA[Shristi]]></dc:creator>
            <pubDate>Sun, 09 Aug 2020 15:12:48 GMT</pubDate>
            <atom:updated>2020-08-11T05:03:48.405Z</atom:updated>
            <content:encoded><![CDATA[<p>Correlated Subquery is a type of subquery.</p><p>Correlated Subquery is different from the normal subquery in terms of execution.</p><h3><em>A correlated subquery is evaluated once for each row of the outer query. SELECT, UPDATE, or DELETE statement can be the outer query</em></h3><p>The Correlated subquery is slower compared to a normal subquery.</p><p>It depends on the outer query.</p><p>A correlated query goes through every row in the table and compares each row against the related data.</p><p>A correlated subquery is used when an action as to be performed on each row in your query that depends on one or more values from that row.</p><h3><strong>Demo table</strong></h3><p>Employee Table</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/519/1*eyGnem3gsmmf3p43llvBQg.png" /></figure><p>Department Table</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/360/1*u4Rgmh3u-kLOVE6O-6xbTw.png" /></figure><p><strong>Syntax:</strong></p><blockquote>SELECT column_name(s)</blockquote><blockquote>FROM table1_name mainq</blockquote><blockquote>WHERE column_name(s) operator →<em> </em><strong><em>outer query</em></strong></blockquote><blockquote>(SELECT column_name(s) FROM table2_name</blockquote><blockquote>WHERE expr1 =mainq.expr2); → <strong><em>inner query</em></strong></blockquote><p><strong>Example:</strong></p><blockquote>SELECT Emp_name, Job, Salary</blockquote><blockquote>FROM Emp mainq WHERE Salary &gt;</blockquote><blockquote>(SELECT AVG(Salary) FROM Emp WHERE Dept_id=mainq.Dept_id);</blockquote><p><strong>Output:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/269/1*yy-Co4aNaRZ-dMRz2VUe6g.png" /></figure><p><strong>Explanation:</strong></p><p>The Correlated Subquery ‘Select AVG(Salary) from Employee where Dept_id=mainq.Dept_id’ is executed and the control is passed to the outer query and then compared with Correlated Subquery. It is continued until the condition is satisfied</p><h3>CORRELATED UPDATE :</h3><p>Use a correlated subquery to update rows in one table based on rows from another table.</p><p><strong>Syntax:</strong></p><blockquote>UPDATE TABLE1 SET COLUMN→<em> </em><strong><em>outer query</em></strong></blockquote><blockquote>=(SELECT column_name(s) FROM table2_name</blockquote><blockquote>WHERE expr1 =mainq.expr2); → <strong><em>inner query</em></strong></blockquote><p><strong>Example:</strong></p><blockquote>UPDATE Emp Set Job</blockquote><blockquote>=(SELECT DNAME from DEPT</blockquote><blockquote>Where Dept.Dept_id = Emp.Dept_id)</blockquote><blockquote>from Emp</blockquote><p><strong>Output</strong>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/503/1*pHpR5DPinI6hyU79zYj2uQ.png" /></figure><p><strong>Explanation:</strong></p><p>This query is to replace the NULL Job in the Emp table by using the DEPT table.</p><h3>CORRELATED DELETE :</h3><p>Use a correlated subquery to delete rows in one table based on the rows from another table.</p><p><strong>Syntax:</strong></p><blockquote>DELETE FROM table1_name mainq</blockquote><blockquote>WHERE column_name(s) operator →<em> </em><strong><em>outer query</em></strong></blockquote><blockquote>(SELECT column_name(s) FROM table2_name</blockquote><blockquote>WHERE expr1 =mainq.expr2); → <strong><em>inner query</em></strong></blockquote><p><strong>Example:</strong></p><blockquote>DELETE FROM Emp WHERE Dept_Id</blockquote><blockquote>=(SELECT d.Dept_Id FROM Dept d</blockquote><blockquote>WHERE d.Dept_id=Emp.Dept_id)</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e271ef552f87" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Pivot and Unpivot in Power BI]]></title>
            <link>https://shristi08.medium.com/pivot-and-unpivot-in-power-bi-ef0f3af086e1?source=rss-72c010bf5f7d------2</link>
            <guid isPermaLink="false">https://medium.com/p/ef0f3af086e1</guid>
            <category><![CDATA[power-bi]]></category>
            <category><![CDATA[pivot-in-power-bi]]></category>
            <category><![CDATA[unpivot-in-powerbi]]></category>
            <dc:creator><![CDATA[Shristi]]></dc:creator>
            <pubDate>Mon, 03 Feb 2020 09:17:57 GMT</pubDate>
            <atom:updated>2020-02-03T09:18:42.339Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Pivot tables</strong> are used to summarize, sort, reorganize, group, count, total or average data stored in a database. It allows its users to transform columns into rows and rows into columns. It allows grouping by any data field.</p><p><strong>Unpivot </strong>is inverse of Pivot it is used to transform rows to columns</p><p>Example-</p><p>Get Data from a source</p><p>Here, I am going to use a table of products which columns as Prod_name, Address and Amount</p><p>Click on Edit queries</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/626/1*j-9BTo9ENP8P4INPJeV7NQ.png" /></figure><p>Then Power Query Editor gets open goto the transform tab</p><p>Select a column on which you want to apply Pivot I have selected Address column and click on Pivot column</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/804/1*AtwyUP5P7vNx4KNRS2laJw.png" /></figure><p>A Pivot column dialog box will appear it will ask you to select the values column and In advance options, select Don’t Aggregate</p><p>Click Ok</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/693/1*aX3QHPEKBU4gZ8vjsp2Mfw.png" /></figure><p>The following is the output of a pivot here address rows are transformed to a column and the amount data is distributed in them according to the Prod_name</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/563/1*NaRBLaT1nqStxPkFEFWCQQ.png" /></figure><p>To <strong>Unpivot</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/957/1*DlUpI4KmeIEvRUZIDWOchQ.png" /></figure><p>Select the column which you want to Unpivot I have selected Mumbai and Pune column for unpivot</p><p>Click on Unpivot dropdown and Select<em> Unpivot Only Selected Columns</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/991/1*HU0id5Ng1mdevPKWHmYwMg.png" /></figure><p>The data in the table will be arranged as it was before we applied the Pivot function</p><p>The columns names are not retained but columns are divided o the basis of Attribute and Value</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/754/1*jyuN2cc_g0TBtKHfyRYPXg.png" /></figure><p>If you are a newbie to Power BI starts with the following must-watch video:-</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2F1b92aR55iaI%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D1b92aR55iaI&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2F1b92aR55iaI%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/5ddd9795e267f721a19caafeea660137/href">https://medium.com/media/5ddd9795e267f721a19caafeea660137/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ef0f3af086e1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Converting hours column into day & hours and Concatenation in Power BI]]></title>
            <link>https://shristi08.medium.com/converting-hours-column-into-day-hours-and-concatenation-in-power-bi-36499247e2c6?source=rss-72c010bf5f7d------2</link>
            <guid isPermaLink="false">https://medium.com/p/36499247e2c6</guid>
            <category><![CDATA[power-bi-tutorials]]></category>
            <category><![CDATA[hours-to-day]]></category>
            <category><![CDATA[power-bi-desktop]]></category>
            <category><![CDATA[concatenation]]></category>
            <dc:creator><![CDATA[Shristi]]></dc:creator>
            <pubDate>Wed, 29 Jan 2020 12:26:14 GMT</pubDate>
            <atom:updated>2020-01-29T12:26:14.505Z</atom:updated>
            <content:encoded><![CDATA[<p>In here we are going to convert the hour&#39;s column to days and hour by using variables</p><p>This variable will calculate the day and hours from the Hours column will act as input for the new column</p><p>In this example, we are calculating the employee leave days form the vacation hours</p><p>In Power BI Click on Get Data and select SQL Server the source of data</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/409/1*ZS9enizfWbRktQlYMfM1Ow.png" /></figure><p>Then enter the Database engine name and click Ok</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/691/1*l7hMV1bAD7IPmlnp_sjcFg.png" /></figure><p>Select the tables from the database</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/865/1*5aT3O3pprmTGpxnTbOroqA.png" /></figure><p>Go to the Data tab at the left which displays the table and in the Modeling tab click on New Column</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DYgdxiBBvrfePAk7ecbqZw.png" /></figure><p>In the column added will show above the Column = here we have to write the DAX query</p><p>I am using VacationHours column for conversion</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xRG0hZyGTW8Dmm0JM3dOSg.png" /></figure><p>To convert the hours data into days and hours we need to replace the Column= with following query :-</p><p>Employee Leave =</p><p>var DayNo=INT([VacationHours]/24)</p><p>var HourNo=INT((Mod([VacationHours],24)))</p><p>return</p><p>DayNo&amp;” day “&amp;FORMAT(HourNo,”#00&quot;)&amp;” hours”</p><p>To execute this query click on the column being created</p><p>In the below image, you can see the hours are being spilt to day and hour</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4YMZ1NTmTZbOcoF5QebUlw.png" /></figure><p>Concatenation function used to join two or more string together</p><p>In this example, we are concatenating FirstName and LastName as FullName</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/911/1*ZtvTt3rg4o-vqeEpjqraDg.png" /></figure><p>same as above take a new column to add this query:-</p><p>Full Name = CONCATENATE(CONCATENATE(‘Person Person’[FirstName],” “),(‘Person Person’[LastName]))</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/872/1*i6iE7U-VpjtuMCCYxUXZyA.png" /></figure><p><strong><em>If you are new to MSBI start with the following must-watch video: -</em></strong></p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FmGPJx3ocFgg%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DmGPJx3ocFgg&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FmGPJx3ocFgg%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/c3515d251493b533b499ced7cfcfe62c/href">https://medium.com/media/c3515d251493b533b499ced7cfcfe62c/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=36499247e2c6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[SSRS Report with dropdown]]></title>
            <link>https://shristi08.medium.com/ssrs-report-with-dropdown-7a664e8ae849?source=rss-72c010bf5f7d------2</link>
            <guid isPermaLink="false">https://medium.com/p/7a664e8ae849</guid>
            <category><![CDATA[ssrs]]></category>
            <category><![CDATA[report]]></category>
            <category><![CDATA[dropdownlist-report]]></category>
            <dc:creator><![CDATA[Shristi]]></dc:creator>
            <pubDate>Tue, 28 Jan 2020 12:24:58 GMT</pubDate>
            <atom:updated>2020-01-28T12:36:57.239Z</atom:updated>
            <content:encoded><![CDATA[<h3>Dropdown List and Interactive sort Report in SSRS</h3><p>SQL Server Reporting Services is used to create reports using a bar graph, pie diagrams, tabular, etc.</p><p>In this SSRS project, we will include drop-down display the data in the report according to value selected from SQL Server Data source</p><p>Create a new SSRS Project select the report wizard a dialog box will appear in which we have to configure the data source and data set for the report</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/728/1*Ty8LpEIejAPeFUkXvqbKHQ.png" /></figure><p>Select the New data source, type as Microsoft SQL Server and click on Edit there enter the database engine name as server name and database name</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/718/1*xpZFzLHB3dMgjy3HBm8yfw.png" /></figure><p>After clicking next Design the query wizard will appear to click on Query Builder</p><p>On the right side select the columns from tables from the list of tables and Run Query to see the output click ok</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/912/1*iuf-cVgbvxyrUXZcRor-4A.png" /></figure><p>Now you can see the query click next</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/725/1*JM_8TDW4f7c8YGmIydNhwQ.png" /></figure><p>Select the Report type as Tabular</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/715/1*EFMejzdD7GmuYH-yFTF2Nw.png" /></figure><p>Add the columns you want to in the report as an attribute in Details and if you want to group these attributes together you can add them to group</p><p>Here, I am adding all column to Details</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/716/1*_1K39WFyjXVwhqKKiVx5rQ.png" /></figure><p>Rename the Report</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/719/1*YG8AmcS0O9Sbbb4vUJBzAA.png" /></figure><p>You can see the Report created</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-xGFFT1tuP6PfqOfbYEc8Q.png" /></figure><p>A Datasource and Data set is created</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/213/1*JbkHgtFGD_NaaOhPEhh01Q.png" /></figure><p><strong>To create a textbox parameter and dropdown parameter</strong></p><p>In Report Data right-click on the DataSet1 and select Query</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/344/1*tw5I0cEE17iJiHc3iwgKsw.png" /></figure><p>In Query Designer click on Edit as Text in the above tab</p><p>A query window will appear in this query we are going to add a where a condition for the department.name equal to the parameter name @Department which will take input values as dropdown and will pass the value from parameter to the where the condition is stated below</p><p>WHERE HumanResources.Department.Name=<a href="http://twitter.com/Department">@Department</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/916/1*ulyGLdHbMUmjQeLcuueGCw.png" /></figure><p>click Ok</p><p>Now in Report Data the parameter @Department is made by the query</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/215/1*nmEqs48KM5fuNL_mM_3Dnw.png" /></figure><p>Right-click on the Data set and select Add Dataset</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/363/1*QTxDmNwQaGEeCMYjhkhVAA.png" /></figure><p>In Dataset properties select Use a dataset embedded in my report and in data source take DataSource1</p><p>Click on Query Designer</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/752/1*qjP1LtQvUU3A64--ni1Mng.png" /></figure><p>Add the Department name column from the Department table</p><p>SELECT<br> HumanResources.Department.Name<br>FROM<br> HumanResources.Department</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/908/1*Y_CFf7KWoKYUOVpSCNk6Cw.png" /></figure><p>click ok</p><p>In Report Data right-click on Department parameter and select the parameter properties</p><p>If the Allow multiple values checkbox is checked then uncheck it</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/677/1*0xIvE48-OhCceTCdV3Ol5g.png" /></figure><p>In the Available values select the Get values from a query set Dataset as dataset2 and select the field which will act as the input to parameter Department click Ok</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/671/1*0pzZO8N1Smo-tOokx_exPA.png" /></figure><p>Now go to preview you can see the Department dropdown at the top you can select any value and click on View Report</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nGuSsWs8RmiXWQ2eQFtiuQ.png" /></figure><p><strong>To create interactive sorting</strong></p><p>Go to the Design tab select a column and right-click select TextBox properties</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qjFSI-FMQnR1oRRX1J9SFg.png" /></figure><p>In TextBox Properties goto Interactive sorting and in Sort by select the column name and click ok</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/675/1*kBIBfXeaukFq56atQcNC0Q.png" /></figure><p>It will sort data in column ascending or descending order</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wSn1bDC7BiJLZZkKGmSizA.png" /></figure><p><strong><em>If you are new to MSBI start with the following must-watch video: -</em></strong></p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FmGPJx3ocFgg%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DmGPJx3ocFgg&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FmGPJx3ocFgg%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/bb89cef475909b6c56591fbf9cf9c659/href">https://medium.com/media/bb89cef475909b6c56591fbf9cf9c659/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7a664e8ae849" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[SSRS Report from Stored procedure with multiple parameters]]></title>
            <link>https://shristi08.medium.com/ssrs-report-from-stored-procedure-with-multiple-parameters-43c30c4fab9e?source=rss-72c010bf5f7d------2</link>
            <guid isPermaLink="false">https://medium.com/p/43c30c4fab9e</guid>
            <category><![CDATA[multi-parameter-report]]></category>
            <category><![CDATA[ssrs]]></category>
            <category><![CDATA[stored-procedure-report]]></category>
            <category><![CDATA[report]]></category>
            <dc:creator><![CDATA[Shristi]]></dc:creator>
            <pubDate>Sat, 25 Jan 2020 10:48:44 GMT</pubDate>
            <atom:updated>2020-01-25T10:49:17.685Z</atom:updated>
            <content:encoded><![CDATA[<p>A <strong>report </strong>contains data retrieval and layout information it is used to interpret the data in the tables in a more understandable form</p><p>The following SSRS report which fetches the data through the stored procedure in MSSQL server</p><p>Stored Procedure code:</p><p>Create Procedure [dbo].[Salesbyprom]</p><p>@PromotionKey int, @SalesTK int</p><p>AS</p><p>Select * from Factresell</p><p>Where PromotionKey=@PromotionKey and SalesTerritoryKey=@SalesTK</p><p>This stored procedure retrieves data from the table on the base of two-parameters salesterritorykey and promotionkey</p><p>In visual studio data tools create a new Reporting Services project</p><p>Select Report Server Project Wizard</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/941/1*_V2KyhjNBYqi--lDszCVKQ.png" /></figure><p>A report Wizard will appear to select the Data Source to click on the new data source and take Type as Microsoft SQL Server and click on Edit button</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/725/1*TZhadPQUwOyFyeMz09oUTw.png" /></figure><p>Give your Database Engine Server name and select the database in which the stored procedure is stored</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/557/1*IweBhHb_dWdQtAcVDVNMVQ.png" /></figure><p>Click Ok and Next</p><p>Design the Query click on Query Bulider</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/719/1*ZyeT1Z8-JXblzhsKX9Yt3g.png" /></figure><p>In the database, view select the Stored procedure that you want to export set the parameter values as null</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/916/1*Q6xza01f-Jowr3vw1eqtVg.png" /></figure><p>Select the Report Type as Tabular</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/724/1*NyncyVKo_4KfIa-X2X1gWQ.png" /></figure><p>The page option is used to create different report pages on different fields</p><p>Group is similar to the group by clause used in SQL Details are used to add an attribute to the report</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*BvIqx6lkJ_EZoP15dpI4PQ.png" /></figure><p>Select the Stepped table layout and check the Include subtotals</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/727/1*wC4PqLW-BofmpWGI-cTm5Q.png" /></figure><p>GiveRepaort a name and click on Finish button</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/733/1*0hDFUx3-3QA_Y0UQoJ5ySw.png" /></figure><p>In the Preview tab, you can see the two parameters uncheck the box beside them pass the value and click on view report</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/965/1*T581wsWbcwLcIn-kg_SGDw.png" /></figure><p>The report can be edited in the Design tab and you can export the file as pdf or print it etc.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/947/1*wRGg258Q90mgOi_sU4-h2g.png" /></figure><p><strong><em>If you are new to MSBI start with the following must-watch video: -</em></strong></p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FmGPJx3ocFgg%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DmGPJx3ocFgg&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FmGPJx3ocFgg%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/c3515d251493b533b499ced7cfcfe62c/href">https://medium.com/media/c3515d251493b533b499ced7cfcfe62c/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=43c30c4fab9e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Creating SQL Profiler Type logging in SSIS]]></title>
            <link>https://shristi08.medium.com/creating-sql-profiler-type-logging-in-ssis-eba686d1e491?source=rss-72c010bf5f7d------2</link>
            <guid isPermaLink="false">https://medium.com/p/eba686d1e491</guid>
            <category><![CDATA[sql-profiler-in-ssis]]></category>
            <category><![CDATA[ssis-tutorial]]></category>
            <category><![CDATA[sql-profiler]]></category>
            <category><![CDATA[ssis-training]]></category>
            <dc:creator><![CDATA[Shristi]]></dc:creator>
            <pubDate>Fri, 24 Jan 2020 12:30:36 GMT</pubDate>
            <atom:updated>2020-01-24T12:30:36.291Z</atom:updated>
            <content:encoded><![CDATA[<p>SQL Profiler is used to trace recreate and troubleshoot the problems in the MS SQL Server</p><p>The Trace for monitoring an instance of the Database Engine or Analysis Services.</p><p>Here, we going to generate a SQL Profiler Trace for a Data flow task.</p><p>Create a project in SSIS and Take Data Flow task</p><p>I have defined a Data flow task to take one table from one OLE DB Source sort the sources and inner join both tables using Merge Join and Create a table in the Database</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/715/1*4u7dx8MyjJccjTh6lOjUhA.png" /></figure><p><strong>To create a SQL Profiler Trace</strong></p><p>Go to SSIS tab and in the options select Logging</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/967/1*TIEfKqn2lSUtX6MmUJ7o2g.png" /></figure><p>A dialog box Configure SSIS Logs will appear on the left side there is a checkbox next to the package check that box then Select a Provider type as SSIS log provider for SQL Server Profiler.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1014/1*x3cpvQ15dsQFRGm8EZNlVw.png" /></figure><p>Click on the Add button the SSIS log provider will be seen the table below</p><p>Go to the Details tab that is beside Provider &amp; Logs</p><p>Select the events for which you want logs</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1015/1*ykVArnvt5mXCm3dwamuV1Q.png" /></figure><p>Click on Configuration and select New Connection</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1001/1*seDhk5-G_dzBc0FmEMAkkg.png" /></figure><p>File connection Manager will pop up Select the Usage type as Create file and</p><p>Click on browse</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*WGZciWjt2Ilkp_ydFUnjrA.png" /></figure><p>I have created a New folder in C: and name the file as SSISsqlprofiler.trc and</p><p>Click on Open</p><p>Note:-Don’t create a file and open it just specify the file name and click Open.</p><p>Once done click Ok in the connection manager you can see the filename</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/781/1*FISquEMiDUH1uacKiROH7A.png" /></figure><p>Now execute the package</p><p>After the execution, you will see a file created on the location specified and it will get replaced each time you execute it</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/944/1*bVOMye2fnpHaBgRXDAF7ZA.png" /></figure><p>If you don’t want the previous file to get replaced</p><p>Then add a variable as folderpath with datatype String and give the path of the file</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/956/1*ujkqMLVRxOvZbPoUuna-iw.png" /></figure><p>right-click on the file name in the connection manager and select properties</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/774/1*TO-f02UmQaoZuFNefOO7hg.png" /></figure><p>In properties go to Expression and click on browse</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/442/1*HjPTUrdGzjHe-ca6EpFoSg.png" /></figure><p>Select ConnectionString from the Property dropdown and click on the browse</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/430/1*cNS8lZvnpSbBEvi-2eNBRw.png" /></figure><p>you can drag and drop the variable name from the Variable and Parameters</p><p>This following expression defines the filename it concatnates the package name with current date and time:-</p><p>@[User::folderpath]+@[System::PackageName]+”_”+Replace(Substring((DT_STR,50,1252)getdate(),1,17),”:”,””)+”.trc”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/565/1*nzF-4Kgt5w7KiWouT_Og8g.png" /></figure><p>Then click Ok</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/437/1*RLnVtU3XYp5CZ28rvwiSEw.png" /></figure><p>You can see the files are not getting replaced but each time we execute a new file is getting created</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/699/1*AptCmV2SIdm4_ZKwaq5szA.png" /></figure><p>You can open the files in the SQL Server Profiler</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*OhU4Q3iQW5VCrZiPpGzT7A.png" /></figure><p><strong><em>If you are new to MSBI start with the following must-watch video: -</em></strong></p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FmGPJx3ocFgg%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DmGPJx3ocFgg&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FmGPJx3ocFgg%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/c3515d251493b533b499ced7cfcfe62c/href">https://medium.com/media/c3515d251493b533b499ced7cfcfe62c/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=eba686d1e491" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Merge Join in SSIS]]></title>
            <link>https://shristi08.medium.com/merge-join-in-ssis-f48ad8e905f8?source=rss-72c010bf5f7d------2</link>
            <guid isPermaLink="false">https://medium.com/p/f48ad8e905f8</guid>
            <category><![CDATA[ssi]]></category>
            <category><![CDATA[ssis-tutorial]]></category>
            <category><![CDATA[merge-join]]></category>
            <dc:creator><![CDATA[Shristi]]></dc:creator>
            <pubDate>Wed, 22 Jan 2020 12:22:48 GMT</pubDate>
            <atom:updated>2020-01-24T06:40:50.283Z</atom:updated>
            <content:encoded><![CDATA[<p>Merge Join in SSIS is used to join two sorted source of data together to form one result set</p><p>The following is an example:-</p><p>I am using two tables one is Post and another one is PostTypes from StackOverflow2010 DB</p><p>Here in this example, we are going to do inner join both tables on the basis of the PostTypeid of Post and id of PostType</p><p>To get a result set i.e. a table stating the type of post is being posted by user</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/352/1*5BH_INnJh_HK393QNCagWQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*L7jHi2xwkePVrjLEDLKa-A.png" /><figcaption>Post Table</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/161/1*oJPBWm9io5q9bGr3y2mOsA.png" /><figcaption>PostTypes Table</figcaption></figure><p>Step 1:Open a new SSIS project take a DataFlow Task in Control Flow of the package</p><p>Now go to the DataFlow tab and add two OLE DB Source</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/755/1*RsgY5zVvFOdjW8spkepWsQ.png" /></figure><p>Step 2: Configure the OLE DB Source Editor Click new and Give your Server Name and Database Name that you want to connect</p><p>Step 3:Select Data access mode as Table or View</p><p>Select the table from the dropdown here I selected Post in the POST OLEDB Source</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/821/1*ot9PBAspAMuE66Xb2fvP-w.png" /></figure><p>Check the Columns tab in the left and select all the columns</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/806/1*Le4PzuIlBJYjV7ONfGi16A.png" /></figure><p>Step 4:Same for POST TYPE Source</p><p>Select the table PostType</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/818/1*4ESemeura4MM_g-zyF_5wQ.png" /></figure><p>Check the Column tab and select all columns</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/816/1*5MWLlZ3LqiWr5c99h8HnFw.png" /></figure><p>Step 5: Add Sort function below the source the data from both the sources need to sort for applying merge operation</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/729/1*ySmOyPvL9pcdPD17z3iWFQ.png" /></figure><p>Step 6: Select PostTypeId column for sorting in the Post source sort and let all other rows Pass through</p><p>Check the Checkbox, at last, to remove duplicate rows and Click OK</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/733/1*BogtmHOYlCaNcwt5X1AfJw.png" /></figure><p>We need to sort the table that is coming from the source so that the data is in the for both</p><p>Step 7: Select the Id column from PostType for sorting and let Type column pass-through</p><p>Check the Checkbox, at last, to remove duplicate rows and Click OK</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/797/1*ycHpMKgnoQBaG7dbNfsnXA.png" /></figure><p>Step 8: Add Merge Join Component and connect both the sort</p><p>A dialog box will ask for input Select Merge Join Left Input for the Post Source and Merge Join Right Input for PostType</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/542/1*8fUH-xCsJfiDvzvjLJKzaQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/767/1*yoFJSOgYlPIlHh0a6n09DA.png" /></figure><p>Step 9: Select Join type Inner join and Check PostTypeId from left as Join key and Id as Join key from right</p><p>Uncheck the Id column at right</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/664/1*E2_7GFUjCvb2XKP9hHKj1A.png" /></figure><p>Step 10: Add OLEDB destination and connect it to merge join</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/748/1*4I2b8SX83-smFtC8xuBpAw.png" /></figure><p>Step 11: Configure OLE DB destination select the Data access mode as Table or view</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/813/1*291TkM8oNc6AYX04J1H0IA.png" /></figure><p>Step 12:Click on New that is next to Name of the table a dialog box will pop up as shown below here the Table is renamed to Postypedt</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/820/1*EW5vEq36cSSBQM2Q5MJLSw.png" /></figure><p>Check the column mappings if the columns are mapped and Click Ok</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/823/1*phHxC7jyCZ6PSq_Q43VPMA.png" /></figure><p>Step 13:Execute the package</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/839/1*326q3lPxHIVw_VBQ7lZe6g.png" /></figure><p>To check if the data is merged run the following query in SQL</p><p>SELECT [Id]</p><p>,[AcceptedAnswerId]</p><p>,[AnswerCount]</p><p>,[Body]</p><p>,[ClosedDate]</p><p>,[CommentCount]</p><p>,[ViewCount]</p><p>,[Type]</p><p>FROM [StackOverflow2010].[dbo].[Postypedt]</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/946/1*DdLK3qPlrHcTz2KOu2MLdA.png" /></figure><p><strong><em>If you are new to MSBI start with the following must-watch video: -</em></strong></p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FmGPJx3ocFgg%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DmGPJx3ocFgg&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FmGPJx3ocFgg%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/c3515d251493b533b499ced7cfcfe62c/href">https://medium.com/media/c3515d251493b533b499ced7cfcfe62c/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f48ad8e905f8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Implicit vs Explicit Conversion in terms of performance]]></title>
            <link>https://shristi08.medium.com/implicit-vs-explicit-conversion-in-terms-of-performance-3fc2e6199120?source=rss-72c010bf5f7d------2</link>
            <guid isPermaLink="false">https://medium.com/p/3fc2e6199120</guid>
            <category><![CDATA[conversion]]></category>
            <category><![CDATA[sql]]></category>
            <category><![CDATA[implicit-conversion]]></category>
            <category><![CDATA[learn-sql]]></category>
            <category><![CDATA[explicit]]></category>
            <dc:creator><![CDATA[Shristi]]></dc:creator>
            <pubDate>Wed, 15 Jan 2020 12:28:07 GMT</pubDate>
            <atom:updated>2020-01-17T06:18:23.465Z</atom:updated>
            <content:encoded><![CDATA[<p>Implicit and Explicit conversion is done to convert the data from one data type to another data type</p><p>Implicit conversion is the conversion which is done by SQL server automatically</p><p>Explicit conversion is the conversion done by a user to convert datatypes using cast, convert parse, etc. functions</p><p>Here we are going to compare both of the conversion types with respect to performance</p><p>Example:</p><p>I will be using these two tables one is the User table and another one is the PostType table for comparison.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/966/1*FUctnmhbOklfg0gSxim22g.png" /><figcaption>User Table</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/148/1*2Vn5aFlonmMHbwhmnZUmqQ.png" /><figcaption>PostType Table</figcaption></figure><p>Firstly I am going to execute a Query without any conversion with Set Statistics Time on to displays the number of milliseconds required to parse, compile, and execute each statement and.</p><p>Query :</p><p>Set Statistics Time on</p><p>Select usr.id, usr.Displayname,usr.Points,ptype.Type</p><p>from dbo.Users usr</p><p>Left join PostTypes ptype</p><p>on usr.Id= ptype.Id</p><p>Where usr.AccountId=’96266&#39;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/601/1*20kErObL9f4xRXTYRe9Q9A.png" /></figure><p>In the above example, the CPU time required for the whole query to execute is 0</p><p>That means it does not cost much and takes less time too</p><p><strong>Implicit Conversion</strong></p><p>Query:</p><p>Set Statistics Time on</p><p>Set Statistics io on</p><p>Select usr.id, usr.Displayname,usr.Points,ptype.Type</p><p>from dbo.Users usr</p><p>Left join PostTypes ptype</p><p>on usr.Id= ptype.Id</p><p>Where usr.AccountId=N’96266&#39;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/934/1*FPkVIRIlhZ6f7vVg6UHavw.png" /></figure><p>This takes more CPU Time then Explicit Conversion</p><p><strong>Explicit Conversion</strong></p><p>Query:</p><p>Set Statistics Time on</p><p>Set Statistics io on</p><p>Select usr.id, usr.Displayname,usr.Points,ptype.Type</p><p>from dbo.Users usr</p><p>Left join PostTypes ptype</p><p>on usr.Id= ptype.Id</p><p>Where usr.AccountId=Convert (Varchar,N’96266&#39;)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/941/1*sTNgtS3H8-0jrtAw1blhJQ.png" /></figure><p>This takes comparingly less CPU Time then implicit Conversion which shows that Explicit Conversion is faster than Implicit conversion</p><p>If you are new to SQL Server start with the following must-watch video: -</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FuGlfP9o7kmY%3Fstart%3D1%26feature%3Doembed%26start%3D1&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DuGlfP9o7kmY&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FuGlfP9o7kmY%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/23e9ad5a5a5f4cec7d26048767a7305b/href">https://medium.com/media/23e9ad5a5a5f4cec7d26048767a7305b/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3fc2e6199120" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Top Resource Consuming Queries]]></title>
            <link>https://shristi08.medium.com/top-resource-consuming-queries-ba2f0657bcd6?source=rss-72c010bf5f7d------2</link>
            <guid isPermaLink="false">https://medium.com/p/ba2f0657bcd6</guid>
            <category><![CDATA[query-store]]></category>
            <category><![CDATA[sql]]></category>
            <category><![CDATA[sql-tutorial]]></category>
            <category><![CDATA[topresourceconsumingquery]]></category>
            <dc:creator><![CDATA[Shristi]]></dc:creator>
            <pubDate>Tue, 14 Jan 2020 12:38:30 GMT</pubDate>
            <atom:updated>2020-01-14T12:39:23.947Z</atom:updated>
            <content:encoded><![CDATA[<p>Query Store</p><p>A Query Store will store the multiple execution plans of the same query. And, You and I can analyze different execution plans for the same query, choose the efficient one and force query to use plan. Now, You can quickly recall a procedure cache. Yes, procedure cache also stores the execution plans but it stores the latest execution plan only. You and I also need to remember that these plans stored in the Procedure Cache will be wiped out due to memory pressure which is not the case with the Query Store.</p><p><strong>How to enable Query Store</strong></p><p>there two ways to enable query Store</p><p>1.By Script</p><p>ALTER DATABASE database_name SET QUERY_STORE = ON;</p><p>2.Manually</p><p>Right Click on the database on which you want to enable the query store</p><p>On the left select Query Store Change the Operation Mode from Off to Read Write.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/693/1*XIdeXJwW-vUpCj8mMNdK3A.png" /></figure><p>To confirm if the Query Store is on</p><p>you can use the following command :</p><p>Select * from sys.database_query_store_options</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1004/1*Yf0yVQkrHHuwjdWitNUXgQ.png" /></figure><p>OR</p><p>You can see if it is present under your database in the dropdown below Programmability</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/326/1*9_aUXLSmYv9fxVILbpgQcQ.png" /></figure><p>How to plan of one query on another query</p><p>USER TABLE</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/908/1*2jK6d0eVU6jlHh7uKbjiXA.png" /><figcaption>User</figcaption></figure><p>I have created this stored procedure as on the above table which as 299398 rows of data :</p><p>Create Procedure userbypoints</p><p>@Points int</p><p>As</p><p>SELECT * FROM [dbo].[Users]</p><p>WHERE Points=@Points</p><p>Go</p><p>Executed it with two different parameters 1 and 2</p><p>Exec userbypoints @points=2</p><p>Exec userbypoints @points=1</p><p>Below is the view of Top Resource consuming Queries</p><p>In the following list of queries which are most resource-consuming</p><p>In the list, userbypoints stored procedure is at the top there two different plan at right, we can two dots in the graph which show represent the different plan used for the execution</p><p>There are two plans for userbypoints with Plan id 13 and Plan id 22</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qv3DA1r74-jqxuKCbyjpZQ.png" /></figure><p>This is the graphical view of the queries which shows the query and duration required to execute</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/825/1*8UBgcRahIfCzpW10ebolBA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/986/1*lVOCa6gddTadNux_KrSixg.png" /></figure><p>Click on Plan id which you want to force on another and then Click on the execution plan symbol shown below in the red box in the plan summary</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/801/1*h3u3ZzRjyUVGZo6nSIYEkg.png" /></figure><p>OR</p><p>Execute the following command to force plan</p><p>Exec sp_query_store_force_Plan @query_id= 13,Plan_id= 22;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/259/1*6dHV94ugvoxoiD5Akn8Q0A.png" /></figure><p>The tick on the plan indicates the plan is forced successfully</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/978/1*T-nrme46a2kHxGCRajnvHQ.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ba2f0657bcd6" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>