<?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>SQL Scratchpad</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/sql_scratchpad/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/sql_scratchpad/feed.xml</link>
    <description />
    <lastBuildDate>Wed, 17 Apr 2019 03:27:30 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>Query Performing Slow When Issued Against A Partitioned Table</title>
      <link>https://docs.microsoft.com/archive/blogs/sql_scratchpad/query-performing-slow-when-issued-against-a-partitioned-table</link>
      <pubDate>Wed, 03 Sep 2014 06:23:24 GMT</pubDate>
      <dc:creator><![CDATA[Chandra550]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/sql_scratchpad/2014/09/03/query-performing-slow-when-issued-against-a-partitioned-table/</guid>
      <description><![CDATA[&#160;  Recently, when I was working with one of our customer, I came across an interesting issue....]]></description>
      <content:encoded><![CDATA[<p>&#160;</p>  <p>Recently, when I was working with one of our customer, I came across an interesting issue.</p>  <p>Customer have two databases, in the same instance. Let’s say the databases are X and Y.</p>  <p>He have a table T1 in X and table T2 in Y.</p>  <p>Both the tables are exactly same in schema definition, number &amp; type of indexes, amount of data and in almost all the specs.</p>  <p>Only difference is, one of those tables has 2 partitions.</p>  <p>Consider table T2 in database Y has the partitions.</p>  <p>They’re running a simple query like SELECT TOP (5000) * from T1 ORDER BY C1 (on database X – Where we don’t have partitions), the query is giving results almost instantaneously.</p>  <p>Same query when we run in a partitioned table, is taking very long time to finish.</p>  <p>I tried to reproduce the same scenario in my lab machine and was successful.</p>  <p>Please find the below exercise I performed to reproduce the issue.</p>  <p>1. Create a partition function for our testing</p>  <p>CREATE PARTITION FUNCTION PFT (integer)</p>  <p>AS RANGE RIGHT</p>  <p>FOR VALUES</p>  <p>(</p>  <p>125000, 250000, 375000, 500000,</p>  <p>625000, 750000, 875000, 1000000,</p>  <p>1125000, 1250000, 1375000, 1500000,</p>  <p>1625000, 1750000, 1875000, 2000000,</p>  <p>2125000, 2250000, 2375000, 2500000,</p>  <p>2625000, 2750000, 2875000, 3000000,</p>  <p>3125000, 3250000, 3375000, 3500000,</p>  <p>3625000, 3750000, 3875000, 4000000,</p>  <p>4125000, 4250000, 4375000, 4500000,</p>  <p>4625000, 4750000, 4875000, 5000000</p>  <p>);</p>  <p>GO</p>  <p>2. Create a partition scheme on that function</p>  <p>CREATE PARTITION SCHEME PST</p>  <p>AS PARTITION PFT</p>  <p>ALL TO ([PRIMARY]);</p>  <p>3. Create a table on the partition scheme (table with partitions)</p>  <p>CREATE TABLE dbo.T1</p>  <p>(</p>  <p>TID integer NOT NULL IDENTITY(0,1),</p>  <p>Column1 integer NOT NULL,</p>  <p>Padding binary(100) NOT NULL DEFAULT 0x,</p>  <p>CONSTRAINT PK_T1</p>  <p>PRIMARY KEY CLUSTERED (TID)</p>  <p>ON PST (TID)</p>  <p>);</p>  <p>4. Create a table without any partitions (Normal table)</p>  <p>CREATE TABLE dbo.T2</p>  <p>(</p>  <p>TID integer NOT NULL IDENTITY(0,1),</p>  <p>Column1 integer NOT NULL,</p>  <p>Padding binary(100) NOT NULL DEFAULT 0x,</p>  <p>CONSTRAINT PK_T2</p>  <p>PRIMARY KEY CLUSTERED (TID)</p>  <p>ON [PRIMARY]</p>  <p>);</p>  <p>5. Create an auxiliary table “Numbers” which stages temporary data that helps us in populating the tables T1 and T2</p>  <p>CREATE TABLE dbo.Numbers (n bigint PRIMARY KEY);</p>  <p>WITH</p>  <p>L0 AS(SELECT 1 AS c UNION ALL SELECT 1),</p>  <p>L1 AS(SELECT 1 AS c FROM L0 AS A CROSS JOIN L0 AS B),</p>  <p>L2 AS(SELECT 1 AS c FROM L1 AS A CROSS JOIN L1 AS B),</p>  <p>L3 AS(SELECT 1 AS c FROM L2 AS A CROSS JOIN L2 AS B),</p>  <p>L4 AS(SELECT 1 AS c FROM L3 AS A CROSS JOIN L3 AS B),</p>  <p>L5 AS(SELECT 1 AS c FROM L4 AS A CROSS JOIN L4 AS B),</p>  <p>Nums AS(SELECT ROW_NUMBER() OVER (ORDER BY (SELECT NULL)) AS n FROM L5)</p>  <p>INSERT dbo.Numbers WITH (TABLOCKX)</p>  <p>SELECT TOP (10000000) n</p>  <p>FROM Nums</p>  <p>ORDER BY n</p>  <p>OPTION (MAXDOP 1);</p>  <p>6. Insert data into tables T1 and T2</p>  <p>T1</p>  <p>========</p>  <p>INSERT dbo.T1 WITH (TABLOCKX)</p>  <p>(Column1)</p>  <p>SELECT</p>  <p>(ABS(CHECKSUM(NEWID())) % 5) + 1</p>  <p>FROM dbo.Numbers AS N</p>  <p>WHERE n BETWEEN 1 AND 5000000;</p>  <p>T2</p>  <p>========</p>  <p>INSERT dbo.T2 WITH (TABLOCKX)</p>  <p>(Column1)</p>  <p>SELECT</p>  <p>(ABS(CHECKSUM(NEWID())) % 5) + 1</p>  <p>FROM dbo.Numbers AS N</p>  <p>WHERE n BETWEEN 1 AND 5000000;</p>  <p>7. Now if we see the partition information, for T1, using the below query</p>  <p>SELECT</p>  <p>t.name as TableName,i.name as IndexName,</p>  <p>p.partition_id as partitionID,</p>  <p>p.partition_number,rows, fg.name</p>  <p>FROM sys.tables AS t </p>  <p>INNER JOIN sys.indexes AS i ON (t.object_id = i.object_id)</p>  <p>INNER JOIN sys.partitions AS p ON (t.object_id = p.object_id and i.index_id = p.index_id)</p>  <p>INNER JOIN sys.destination_data_spaces dds ON (p.partition_number = dds.destination_id)</p>  <p>INNER JOIN sys.filegroups AS fg ON (dds.data_space_id = fg.data_space_id)</p>  <p>WHERE (t.name = 'T1') and (i.index_id IN (0,1))</p>  <p><u>Output</u></p>  <p><u></u></p>  <p>Tab Index partitionID part rows name</p>  <p>Name Name No.</p>  <p>T1 PK_T1 72057594039042048 1 125000 PRIMARY</p>  <p>T1 PK_T1 72057594039107584 2 125000 PRIMARY</p>  <p>T1 PK_T1 72057594039173120 3 125000 PRIMARY</p>  <p>T1 PK_T1 72057594039238656 4 125000 PRIMARY</p>  <p>T1 PK_T1 72057594039304192 5 125000 PRIMARY</p>  <p>T1 PK_T1 72057594039369728 6 125000 PRIMARY</p>  <p>T1 PK_T1 72057594039435264 7 125000 PRIMARY</p>  <p>T1 PK_T1 72057594039500800 8 125000 PRIMARY</p>  <p>T1 PK_T1 72057594039566336 9 125000 PRIMARY</p>  <p>T1 PK_T1 72057594039631872 10 125000 PRIMARY</p>  <p>T1 PK_T1 72057594039697408 11 125000 PRIMARY</p>  <p>T1 PK_T1 72057594039762944 12 125000 PRIMARY</p>  <p>T1 PK_T1 72057594039828480 13 125000 PRIMARY</p>  <p>T1 PK_T1 72057594039894016 14 125000 PRIMARY</p>  <p>T1 PK_T1 72057594039959552 15 125000 PRIMARY</p>  <p>T1 PK_T1 72057594040025088 16 125000 PRIMARY</p>  <p>T1 PK_T1 72057594040090624 17 125000 PRIMARY</p>  <p>T1 PK_T1 72057594040156160 18 125000 PRIMARY</p>  <p>T1 PK_T1 72057594040221696 19 125000 PRIMARY</p>  <p>T1 PK_T1 72057594040287232 20 125000 PRIMARY</p>  <p>T1 PK_T1 72057594040352768 21 125000 PRIMARY</p>  <p>T1 PK_T1 72057594040418304 22 125000 PRIMARY</p>  <p>T1 PK_T1 72057594040483840 23 125000 PRIMARY</p>  <p>T1 PK_T1 72057594040549376 24 125000 PRIMARY</p>  <p>T1 PK_T1 72057594040614912 25 125000 PRIMARY</p>  <p>T1 PK_T1 72057594040680448 26 125000 PRIMARY</p>  <p>T1 PK_T1 72057594040745984 27 125000 PRIMARY</p>  <p>T1 PK_T1 72057594040811520 28 125000 PRIMARY</p>  <p>T1 PK_T1 72057594040877056 29 125000 PRIMARY</p>  <p>T1 PK_T1 72057594040942592 30 125000 PRIMARY</p>  <p>T1 PK_T1 72057594041008128 31 125000 PRIMARY</p>  <p>T1 PK_T1 72057594041073664 32 125000 PRIMARY</p>  <p>T1 PK_T1 72057594041139200 33 125000 PRIMARY</p>  <p>T1 PK_T1 72057594041204736 34 125000 PRIMARY</p>  <p>T1 PK_T1 72057594041270272 35 125000 PRIMARY</p>  <p>T1 PK_T1 72057594041335808 36 125000 PRIMARY</p>  <p>T1 PK_T1 72057594041401344 37 125000 PRIMARY</p>  <p>T1 PK_T1 72057594041466880 38 125000 PRIMARY</p>  <p>T1 PK_T1 72057594041532416 39 125000 PRIMARY</p>  <p>T1 PK_T1 72057594041597952 40 125000 PRIMARY</p>  <p>T1 PK_T1 72057594041663488 41 0 PRIMARY</p>  <p>8. Now if we see the partition information, for T1, using the below query</p>  <p>SELECT</p>  <p>t.name as TableName,i.name as IndexName,</p>  <p>p.partition_id as partitionID,</p>  <p>p.partition_number,rows, fg.name</p>  <p>FROM sys.tables AS t </p>  <p>INNER JOIN sys.indexes AS i ON (t.object_id = i.object_id)</p>  <p>INNER JOIN sys.partitions AS p ON (t.object_id = p.object_id and i.index_id = p.index_id)</p>  <p>INNER JOIN sys.destination_data_spaces dds ON (p.partition_number = dds.destination_id)</p>  <p>INNER JOIN sys.filegroups AS fg ON (dds.data_space_id = fg.data_space_id)</p>  <p>WHERE (t.name = 'T2') and (i.index_id IN (0,1))</p>  <p><u>Output:</u></p>  <p>Tab IndexName partitionID partition_number rows name</p>  <p>Name</p>  <p>T2 PK_T2 72057594041794560 1 5000000 PRIMARY</p>  <p><u></u></p>  <p>So we confirmed that T1 is partitioned and T2 is not (By default SQL creates one partition for every table that’s why you’re seeing one row for T2) and both have 5,000,000 rows</p>  <p><u></u></p>  <p>9. Now let’s see the indexes on these tables : They have one clustered index each, which is their PRIMARY KEY</p>  <p>USE [partitions_perf_test]</p>  <p>GO</p>  <p>/****** Object: Index [PK_T1] Script Date: 21-04-2014 18:10:10 ******/</p>  <p>ALTER TABLE <b>[dbo].[T1]</b> ADD CONSTRAINT [PK_T1] PRIMARY KEY CLUSTERED</p>  <p>(</p>  <p><b>[TID] ASC</b></p>  <p>)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)</p>  <p>GO</p>  <p>USE [partitions_perf_test]</p>  <p>GO</p>  <p>/****** Object: Index [PK_T2] Script Date: 21-04-2014 18:10:15 ******/</p>  <p>ALTER TABLE <b>[dbo].[T2]</b> ADD CONSTRAINT [PK_T2] PRIMARY KEY CLUSTERED</p>  <p>(</p>  <p><b>[TID] ASC</b></p>  <p>)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]</p>  <p>GO</p>  <p>10. The query we’re going to fire is </p>  <p>select top(100000) * from T1 order by Column1</p>  <p>and</p>  <p>select top(100000) * from T2 order by Column1</p>  <p>11. Customer had another non clustered index on a column which is part of the order by clause i.e., Column1. So, I’m going to crate it now</p>  <p>create index nc1 on T1(Column1)</p>  <p>create index nc1 on T2(Column1)</p>  <p>Now we’re done with all the setup/configuration.</p>  <p>Let’s test the query and examine the explain plans.</p>  <p>Let’s start with T2 (non-partitioned table) first</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/64/09/metablogapi/0020.clip_image001_71E4EFD4.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-64-09-metablogapi/0020.clip_5F00_image001_5F00_71E4EFD4.png"><img title="clip_image001" style="border-top: 0px; border-right: 0px; border-bottom: 0px; border-left: 0px; display: inline" border="0" alt="clip_image001" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/64/09/metablogapi/3660.clip_image001_thumb_65E59051.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-64-09-metablogapi/3660.clip_5F00_image001_5F00_thumb_5F00_65E59051.png" width="244" height="123" /></a></p>  <p>It returned in 1 second.</p>  <p>The reason behind choosing an NC scan followed by a clustered index key look up can be explained as:</p>  <p>We have an order by clause on the column “column1” in the select statement. Optimizer is using the NC-Index to scan as the keys in the NC index are already arranged in the ascending order so we need to do few lookups, starting from left node, moving to root and then right (In-order traversal), on the B-Tree index to get the top 100,000 rows. This avoid the costly SORT operation to arrange the results in an order.</p>  <p>Let’s execute the same query on the partitioned table and see how I behaves,</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/64/09/metablogapi/0160.clip_image003_2A28884F.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-64-09-metablogapi/0160.clip_5F00_image003_5F00_2A28884F.jpg"><img title="clip_image003" style="border-top: 0px; border-right: 0px; border-bottom: 0px; border-left: 0px; display: inline" border="0" alt="clip_image003" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/64/09/metablogapi/1018.clip_image003_thumb_7928D7A1.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-64-09-metablogapi/1018.clip_5F00_image003_5F00_thumb_5F00_7928D7A1.jpg" width="244" height="78" /></a></p>  <p>Here, it’s not at all using the NC-Index. It’s just going for a clustered index scan followed by sort. And also it’s taking around 2 minutes to complete, in my machine. In customer’s environment it’s even more.</p>  <p>What might be the reason behind this behaviour?</p>  <p>I just observed the NC-Index’s properties on both the table – There’s an apparent change in the storage section.</p>  <p><b><u>T2: (Non-Paritioned)</u></b></p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/64/09/metablogapi/1067.clip_image005_56D3D2D9.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-64-09-metablogapi/1067.clip_5F00_image005_5F00_56D3D2D9.jpg"><img title="clip_image005" style="border-top: 0px; border-right: 0px; border-bottom: 0px; border-left: 0px; display: inline" border="0" alt="clip_image005" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/64/09/metablogapi/7380.clip_image005_thumb_5A747E67.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-64-09-metablogapi/7380.clip_5F00_image005_5F00_thumb_5F00_5A747E67.jpg" width="244" height="155" /></a></p>  <p><b><u></u></b></p>  <p><b><u></u></b></p>  <p><b><u></u></b></p>  <p><b><u></u></b></p>  <p><b><u></u></b></p>  <p><b><u></u></b></p>  <p><b><u></u></b></p>  <p><b><u></u></b></p>  <p><b><u></u></b></p>  <p><b><u></u></b></p>  <p><b><u></u></b></p>  <p><b><u></u></b></p>  <p><b><u></u></b></p>  <p><b><u>T1: (Paritioned)</u></b></p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/64/09/metablogapi/7635.clip_image007_33A8F8D8.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-64-09-metablogapi/7635.clip_5F00_image007_5F00_33A8F8D8.jpg"><img title="clip_image007" style="border-top: 0px; border-right: 0px; border-bottom: 0px; border-left: 0px; display: inline" border="0" alt="clip_image007" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/64/09/metablogapi/5047.clip_image007_thumb_172E97A9.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-64-09-metablogapi/5047.clip_5F00_image007_5F00_thumb_5F00_172E97A9.jpg" width="244" height="155" /></a></p>  <p>We created the NC-Index in the same way, using the same definition, on both the tables. But why the index on a Non-Partitioned table is created on the FILEGROUP whereas index on partitioned table is created on the partition scheme?</p>  <p>When a table is partitioned, the subsequent index we create, tries to align themselves as per the table’s structure. So the index will also be partitioned implicitly. i.e., a new B-Tree for every partition, with a new root and new structure, will be created. This is to improve the performance by making parallel localized searches when a partition needs to be traversed.</p>  <p>But, the question is, why my query performance is deteriorated when the index is partitioned?</p>  <p>The reason is: when the index is partitioned, SQL needs to go through each local index (index partition) and scan through it. So optimizer feel that that’s a heavy weighted operation and avoids using that index. This is exactly what’s happening for our NC-Index and it’s not being used.</p>  <p>When I just change the index definition on T1 by switching the storage to FILEGROUP from partition scheme, it also uses the NC index and returns the results fast.</p>  <p>CREATE NONCLUSTERED INDEX [nc1] ON [dbo].[T1]</p>  <p>(</p>  <p>[Column1] ASC</p>  <p>)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = ON, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)</p>  <p>--ON PST(Column1)</p>  <p>ON [PRIMARY]</p>  <p>GO</p>  <p>Removing “ON PST(Column1)” and adding ON [PRIMARY] makes the index created on the default filegroup i.e. PRIMARY.</p>  <p>Let’s test the query now:</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/64/09/metablogapi/8055.clip_image009_4275BF61.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-64-09-metablogapi/8055.clip_5F00_image009_5F00_4275BF61.jpg"><img title="clip_image009" style="border-top: 0px; border-right: 0px; border-bottom: 0px; border-left: 0px; display: inline" border="0" alt="clip_image009" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/64/09/metablogapi/5758.clip_image009_thumb_0CFF8DED.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-64-09-metablogapi/5758.clip_5F00_image009_5F00_thumb_5F00_0CFF8DED.jpg" width="244" height="113" /></a></p>  <p>This is exactly what the execution plan expected to be…</p>  <p>As an alternative to achieve this behaviour without changing the index structure is to use the query hint WITH (INDEX()). The query below also be executed using the same execution plan where it picks up NC-Index.</p>  <p>select top(100000) * from T2 WITH (INDEX(nc1)) order by Column1</p>  <p>As always, please feel free to get in touch with me with your comments or feedback.</p>  <p>&#160;</p>  <p>Thanks,</p>  <p>Chandra</p>]]></content:encoded>
    </item>
    <item>
      <title>“AddNode” operation while setting up SQL 2005 Cluster fails with an error: “Error String : The setup has encountered an unexpected error while Preparing Installation Wizard. The error is: Fatal error during installation. Error Number : 29528”</title>
      <link>https://docs.microsoft.com/archive/blogs/sql_scratchpad/addnode-operation-while-setting-up-sql-2005-cluster-fails-with-an-error-error-string-the-setup-has-encountered-an-unexpected-error-while-preparing-installation-wizard-the-erro</link>
      <pubDate>Thu, 10 Jul 2014 08:12:57 GMT</pubDate>
      <dc:creator><![CDATA[Chandra550]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/sql_scratchpad/2014/07/10/addnode-operation-while-setting-up-sql-2005-cluster-fails-with-an-error-error-string-the-setup-has-encountered-an-unexpected-error-while-preparing-installation-wizard-the-erro/</guid>
      <description><![CDATA[&#160;  Recently, I was working on one of the customers on an issue. The resolution is simple but I...]]></description>
      <content:encoded><![CDATA[<p>&#160;</p>  <p><font size="2" face="Calibri">Recently, I was working on one of the customers on an issue. The resolution is simple but I don’t see much resources online on this.</font></p>  <p><font size="2" face="Calibri">So, wanted to write a blog on this quickly.</font></p>  <p><font size="2" face="Calibri">He’s using SQL 2005 (I didn’t say interesting because it is 2005 ;)) and installed SQL on a node (say Node-A) and now trying to do the obvious next step: yes, you guessed it right (‘AddNode’ on the other node).</font></p>  <p><font size="2" face="Calibri">While doing that he encountered with an error message like</font> </p>  <p>&#160;</p>  <p><font color="#ff0000">Install : Failed </font></p>  <p><font color="#ff0000">Log File : C:\Program Files\Microsoft SQL Server\90\Setup Bootstrap\LOG\Files\SQLSetup0020_XXXX_WI.log </font></p>  <p><font color="#ff0000">Last Action : SetClusterDialogs </font></p>  <p><font color="#ff0000">Error String : The setup has encountered an unexpected error while Preparing Installation Wizard. The error is: Fatal error during installation. </font></p>  <p><font color="#ff0000">Error Number : 29528 </font></p>  <p><font color="#ff0000">-------------------------------------------------------------------------------- </font></p>  <p><font color="#ff0000">SQL Server Setup failed. For more information, review the Setup log file in %ProgramFiles%\Microsoft SQL Server\90\Setup Bootstrap\LOG\Summary.txt.</font></p>  <p><font size="2" face="Calibri">So, I quickly looked in the SQLSetup0020_XXXX_WI.log file, as pointed by the error message above – and it says</font></p>  <p>MSI (c) (90:88) [11:56:10:530]: Note: 1: 1729 </p>  <p>MSI (c) (90:88) [11:56:10:530]: Transforming table Error.</p>  <p>MSI (c) (90:88) [11:56:10:530]: Note: 1: 2262 2: Error 3: -2147287038 </p>  <p>MSI (c) (90:88) [11:56:10:536]: Transforming table Error.</p>  <p>MSI (c) (90:88) [11:56:10:537]: Transforming table Error.</p>  <p>MSI (c) (90:88) [11:56:10:537]: Note: 1: 2262 2: Error 3: -2147287038 </p>  <p>MSI (c) (90:88) [11:56:10:537]: Transforming table Error.</p>  <p>MSI (c) (90:88) [11:56:10:545]: Note: 1: 2262 2: Error 3: -2147287038 </p>  <p>MSI (c) (90:88) [11:56:10:545]: Product: Microsoft SQL Server 2005 (64-bit) -- Configuration failed.</p>  <p>MSI (c) (90:88) [11:56:10:545]: Windows Installer reconfigured the product. Product Name: Microsoft SQL Server 2005 (64-bit). Product Version: 9.4.5000.00. Product Language: 1033. Reconfiguration success or error status: 1603.</p>  <p>MSI (c) (90:88) [11:56:10:550]: Grabbed execution mutex.</p>  <p>MSI (c) (90:88) [11:56:10:550]: Cleaning up uninstalled install packages, if any exist</p>  <p>MSI (c) (90:88) [11:56:10:551]: MainEngineThread is returning 1603</p>  <p><font size="2" face="Calibri">I remember dealing with similar issues earlier, configuration fails by spitting out the “transforming table errors” when we have more than an IP resource configured in the Windows cluster.</font></p>  <p><font size="2" face="Calibri">And I see from the same log that they have 2 IP resources in the cluster</font></p>  <p>&lt;Func Name='ValidateIpAddress'&gt;</p>  <p>&lt;Func Name='ValidateIpAddressX'&gt;</p>  <p><b>Server1 XXX.XXX.XXX Clients 1</b></p>  <p>&lt;EndFunc Name='ValidateIpAddressX' Return='0' GetLastError='0'&gt;</p>  <p>&lt;EndFunc Name='ValidateIpAddress' Return='0' GetLastError='0'&gt;</p>  <p>&lt;Func Name='IPAddressHelperAddToListView'&gt;</p>  <p>MSI (c) (90!A0) [11:54:48:655]: Note: 1: 2262 2: ListBox 3: -2147287038 </p>  <p>&lt;EndFunc Name='IPAddressHelperAddToListView' Return='0' GetLastError='0'&gt;</p>  <p>&lt;Func Name='IPAddressDlgHelperRemoveFromCombo'&gt;</p>  <p>&lt;EndFunc Name='IPAddressDlgHelperRemoveFromCombo' Return='0' GetLastError='0'&gt;</p>  <p>&lt;Func Name='ValidateIpAddress'&gt;</p>  <p>&lt;Func Name='ValidateIpAddressX'&gt;</p>  <p><b>Server1 YYY.YYY.YYY.YYY Clients 1</b></p>  <p>&lt;EndFunc Name='ValidateIpAddressX' Return='0' GetLastError='0'&gt;</p>  <p>&lt;EndFunc Name='ValidateIpAddress' Return='0' GetLastError='0'&gt;</p>  <p>&lt;Func Name='IPAddressHelperAddToListView'&gt;</p>  <p><font size="2" face="Calibri">I masked the IPs as XXX.XXX.XXX.XXX and YYY.YYY.YYY.YYY – you actually will see two different IPV4 addresses there.</font></p>  <p><font size="2" face="Calibri">As soon as I confirmed this, I asked him to follow the sequence of steps below</font></p>  <p><font size="2" face="Calibri">Remove an IP address -&gt; do the “addNode” -&gt; add the IP back</font></p>  <p><font size="2" face="Calibri">He did that and you know the outcome – it worked :)</font></p>  <p><font size="2" face="Calibri"></font></p>  <p><font size="2" face="Calibri">As always, please feel free to get in touch with me with your comments or feedback.</font></p>  <p><font size="2" face="Calibri"></font></p>  <p><font size="2" face="Calibri">Regards,</font></p>  <p><font size="2" face="Calibri">Chandra</font></p>]]></content:encoded>
    </item>
    <item>
      <title>Why is it important to close the keys after retrieving the data from an encrypted table, using Cell level encryption?</title>
      <link>https://docs.microsoft.com/archive/blogs/sql_scratchpad/why-is-it-important-to-close-the-keys-after-retrieving-the-data-from-an-encrypted-table-using-cell-level-encryption</link>
      <pubDate>Sat, 29 Mar 2014 15:04:24 GMT</pubDate>
      <dc:creator><![CDATA[Chandra550]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/sql_scratchpad/2014/03/29/why-is-it-important-to-close-the-keys-after-retrieving-the-data-from-an-encrypted-table-using-cell-level-encryption/</guid>
      <description><![CDATA[When we use cell level encryption, we usually create a symmetric key, do the encryption and close...]]></description>
      <content:encoded><![CDATA[<p style="margin-left: 0in; margin-right: 0in"><span style="font-family: ; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin"><font style="font-size: 12pt">When we use cell level encryption, we usually create a symmetric key, do the encryption and close it. And again when we want to query the data, we open the key, perform the decryption and read the data. Here, in this article, I'll talk about the side effects if you forget/ignore to close the keys you opened for decrypting the data.</font></span></p>  <p style="margin-left: 0in; margin-right: 0in"><span style="font-family: ; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin"><font style="font-size: 12pt">Let’s do a simple exercise to understand how we do the encryption and decryption and we’ll try to replicate the scenario I was talking about.</font></span></p>  <p style="margin-left: 0in; margin-right: 0in"><span style="font-family: ; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin"><font style="font-size: 12pt">First we’ll create 2 logins to play with and a database followed by table with few columns to perform cell level encryption.</font></span></p>  <p style="margin-left: 0in; margin-right: 0in"><span style="font-family: ; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin"><font style="font-size: 12pt">Here we have two managers and they’re storing their employee details like id, name, SSN and rating details in a table called </font></span><span style="font-family: ; color: "><font face="Consolas"><font style="font-size: 9.5pt" color="#008080">EmpTable</font></font></span><span style="font-family: ; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin"><font style="font-size: 12pt">. We’re encrypting the SSN and the rating details as they’re confidential and should only be visible to their respective managers.</font></span></p>  <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"><font face="Consolas"><span style="font-family: ; color: "><font color="#0000ff"><font style="font-size: 9.5pt">Create</font></font></span><span style="font-family: "><font style="font-size: 9.5pt"> <span style="color: "><font color="#0000ff">login</font></span> <span style="color: "><font color="#008080">Man1</font></span> <span style="color: "><font color="#0000ff">with</font></span> <span style="color: "><font color="#0000ff">password</font></span> <span style="color: "><font color="#808080">=</font></span> </font><span style="color: "><font style="font-size: 9.5pt" color="#ff0000">'Man1pwd'</font></span></span></font></p>  <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"><span style="font-family: ; color: "><font face="Consolas"><font style="font-size: 9.5pt" color="#0000ff">Go</font></font></span><span style="font-family: "></span></p>  <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"><font face="Consolas"><span style="font-family: ; color: "><font color="#0000ff"><font style="font-size: 9.5pt">Create</font></font></span><span style="font-family: "><font style="font-size: 9.5pt"> <span style="color: "><font color="#0000ff">login</font></span> <span style="color: "><font color="#008080">Man2</font></span> <span style="color: "><font color="#0000ff">with</font></span> <span style="color: "><font color="#0000ff">password</font></span> <span style="color: "><font color="#808080">=</font></span> </font><span style="color: "><font style="font-size: 9.5pt" color="#ff0000">'Man2pwd'</font></span></span></font></p>  <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"><span style="font-family: ; color: "><font face="Consolas"><font style="font-size: 9.5pt" color="#0000ff">Go</font></font></span></p>  <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"><span style="font-family: "><font face="Consolas"><font style="font-size: 9.5pt">&#160;</font></font></span></p>  <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"><font face="Consolas"><span style="font-family: ; color: "><font color="#0000ff"><font style="font-size: 9.5pt">create</font></font></span><span style="font-family: "><font style="font-size: 9.5pt"> <span style="color: "><font color="#0000ff">database</font></span> </font><span style="color: "><font style="font-size: 9.5pt" color="#008080">CompanyDB</font></span></span></font></p>  <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"><span style="font-family: ; color: "><font face="Consolas"><font style="font-size: 9.5pt" color="#0000ff">go</font></font></span><span style="font-family: "></span></p>  <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"><span style="font-family: ; color: "><font face="Consolas"><font style="font-size: 9.5pt" color="#0000ff">&#160;</font></font></span></p>  <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"><font face="Consolas"><span style="font-family: ; color: "><font color="#0000ff"><font style="font-size: 9.5pt">use</font></font></span><span style="font-family: "><font style="font-size: 9.5pt"> </font><span style="color: "><font style="font-size: 9.5pt" color="#008080">CompanyDB</font></span></span></font></p>  <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"><span style="font-family: ; color: "><font face="Consolas"><font style="font-size: 9.5pt" color="#0000ff">go</font></font></span><span style="font-family: "></span></p>  <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"><font face="Consolas"><span style="font-family: ; color: "><font color="#0000ff"><font style="font-size: 9.5pt">create</font></font></span><span style="font-family: "><font style="font-size: 9.5pt"> <span style="color: "><font color="#0000ff">user</font></span> <span style="color: "><font color="#008080">Man1</font></span></font><span style="color: "><font style="font-size: 9.5pt" color="#808080">;</font></span></span></font></p>  <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"><span style="font-family: ; color: "><font face="Consolas"><font style="font-size: 9.5pt" color="#0000ff">go</font></font></span><span style="font-family: "></span></p>  <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"><font face="Consolas"><span style="font-family: ; color: "><font color="#0000ff"><font style="font-size: 9.5pt">create</font></font></span><span style="font-family: "><font style="font-size: 9.5pt"> <span style="color: "><font color="#0000ff">user</font></span> </font><span style="color: "><font style="font-size: 9.5pt" color="#008080">Man2</font></span></span></font></p>  <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"><span style="font-family: ; color: "><font face="Consolas"><font style="font-size: 9.5pt" color="#0000ff">go</font></font></span><span style="font-family: "></span></p>  <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"><span style="font-family: "><font face="Consolas"><font style="font-size: 9.5pt">&#160;</font></font></span></p>  <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"><font face="Consolas"><span style="font-family: ; color: "><font color="#0000ff"><font style="font-size: 9.5pt">create</font></font></span><span style="font-family: "><font style="font-size: 9.5pt"> <span style="color: "><font color="#0000ff">table</font></span> <span style="color: "><font color="#008080">EmpTable</font></span><span style="color: "><font color="#0000ff"> </font></span><span style="color: "><font color="#808080">(</font></span><span style="color: "><font color="#008080">Id</font></span> <span style="color: "><font color="#0000ff">int</font></span><span style="color: "><font color="#808080">,</font></span> <span style="color: "><font color="#008080">name</font></span> <span style="color: "><font color="#0000ff">nvarchar</font></span><span style="color: "><font color="#808080">(</font></span>30<span style="color: "><font color="#808080">),</font></span> <span style="color: "><font color="#008080">Manname</font></span> <span style="color: "><font color="#0000ff">varchar</font></span><span style="color: "><font color="#808080">(</font></span>20<span style="color: "><font color="#808080">),</font></span> <span style="color: "><font color="#008080">SSN</font></span> <span style="color: "><font color="#0000ff">varbinary</font></span><span style="color: "><font color="#808080">(</font></span>60<span style="color: "><font color="#808080">),</font></span> <span style="color: "><font color="#008080">Rating</font></span> <span style="color: "><font color="#0000ff">varbinary</font></span><span style="color: "><font color="#808080">(</font></span>4000</font><span style="color: "><font style="font-size: 9.5pt" color="#808080">))</font></span></span></font></p>  <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"><span style="font-family: ; color: "><font face="Consolas"><font style="font-size: 9.5pt" color="#0000ff">go</font></font></span><span style="font-family: "></span></p>  <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"><span style="font-family: ; color: "><font face="Consolas"><font style="font-size: 9.5pt" color="#008000">&#160;</font></font></span></p>  <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"><span style="font-family: ; color: "><font face="Consolas"><font style="font-size: 9.5pt" color="#008000">--grant access to the table to both doctors</font></font></span><span style="font-family: "></span></p>  <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"><font face="Consolas"><span style="font-family: ; color: "><font color="#0000ff"><font style="font-size: 9.5pt">grant</font></font></span><span style="font-family: "><font style="font-size: 9.5pt"> <span style="color: "><font color="#0000ff">select</font></span><span style="color: "><font color="#808080">,</font></span><span style="color: "><font color="#0000ff">insert</font></span> <span style="color: "><font color="#0000ff">on</font></span> <span style="color: "><font color="#008080">EmpTable</font></span> <span style="color: "><font color="#0000ff">to</font></span> </font><span style="color: "><font style="font-size: 9.5pt" color="#008080">Man1</font></span></span></font></p>  <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"><font face="Consolas"><span style="font-family: ; color: "><font color="#0000ff"><font style="font-size: 9.5pt">grant</font></font></span><span style="font-family: "><font style="font-size: 9.5pt"> <span style="color: "><font color="#0000ff">select</font></span><span style="color: "><font color="#808080">,</font></span><span style="color: "><font color="#0000ff">insert</font></span> <span style="color: "><font color="#0000ff">on</font></span> <span style="color: "><font color="#008080">EmpTable</font></span> <span style="color: "><font color="#0000ff">to</font></span> </font><span style="color: "><font style="font-size: 9.5pt" color="#008080">Man2</font></span></span></font></p>  <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"><span style="font-family: "><font face="Consolas"><font style="font-size: 9.5pt">&#160;</font></font></span></p>  <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"><span style="mso-fareast-font-family: &quot;Times New Roman&quot;; mso-bidi-font-family: &quot;Times New Roman&quot;; mso-fareast-language: en-in"><font style="font-size: 12pt">Then we’ll create a Database master key, two certificates for both the users and two symmetric keys using their respective keys</font></span></p>  <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"><span style="font-family: ; color: "><font face="Consolas"><font style="font-size: 9.5pt" color="#0000ff">&#160;</font></font></span></p>  <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"><font face="Consolas"><span style="font-family: ; color: "><font color="#0000ff"><font style="font-size: 9.5pt">CREATE</font></font></span><span style="font-family: "><font style="font-size: 9.5pt"> <span style="color: "><font color="#0000ff">MASTER</font></span> <span style="color: "><font color="#0000ff">KEY</font></span> <span style="color: "><font color="#0000ff">ENCRYPTION</font></span> <span style="color: "><font color="#0000ff">BY</font></span> <span style="color: "><font color="#0000ff">PASSWORD</font></span> <span style="color: "><font color="#808080">=</font></span> </font><span style="color: "><font style="font-size: 9.5pt" color="#ff0000">'CompanyDB1'</font></span></span></font></p>  <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"><span style="font-family: "><font face="Consolas"><font style="font-size: 9.5pt">&#160;</font></font></span></p>  <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"><font face="Consolas"><span style="font-family: ; color: "><font color="#0000ff"><font style="font-size: 9.5pt">create</font></font></span><span style="font-family: "><font style="font-size: 9.5pt"> <span style="color: "><font color="#0000ff">certificate</font></span> <span style="color: "><font color="#008080">Man1Cert</font></span> <span style="color: "><font color="#0000ff">authorization</font></span> <span style="color: "><font color="#008080">Man1</font></span> <span style="color: "><font color="#0000ff">with</font></span> <span style="color: "><font color="#0000ff">subject</font></span> <span style="color: "><font color="#808080">=</font></span> <span style="color: "><font color="#ff0000">'Man1cert'</font></span><span style="color: "><font color="#808080">,</font></span> <span style="color: "><font color="#0000ff">START_DATE</font></span> <span style="color: "><font color="#808080">=</font></span> </font><span style="color: "><font style="font-size: 9.5pt" color="#ff0000">'10/09/2013'</font></span></span></font></p>  <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"><span style="font-family: ; color: "><font face="Consolas"><font style="font-size: 9.5pt" color="#0000ff">go</font></font></span><span style="font-family: "></span></p>  <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"><span style="font-family: "><font face="Consolas"><font style="font-size: 9.5pt">&#160;</font></font></span></p>  <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"><font face="Consolas"><span style="font-family: ; color: "><font color="#0000ff"><font style="font-size: 9.5pt">create</font></font></span><span style="font-family: "><font style="font-size: 9.5pt"> <span style="color: "><font color="#0000ff">certificate</font></span> <span style="color: "><font color="#008080">Man2Cert</font></span> <span style="color: "><font color="#0000ff">authorization</font></span> <span style="color: "><font color="#008080">Man2</font></span> <span style="color: "><font color="#0000ff">with</font></span> <span style="color: "><font color="#0000ff">subject</font></span> <span style="color: "><font color="#808080">=</font></span> <span style="color: "><font color="#ff0000">'Man2cert'</font></span><span style="color: "><font color="#808080">,</font></span> <span style="color: "><font color="#0000ff">START_DATE</font></span> <span style="color: "><font color="#808080">=</font></span> </font><span style="color: "><font style="font-size: 9.5pt" color="#ff0000">'10/09/2013'</font></span></span></font></p>  <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"><span style="font-family: ; color: "><font face="Consolas"><font style="font-size: 9.5pt" color="#0000ff">go</font></font></span><span style="font-family: "></span></p>  <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"><span style="font-family: "><font face="Consolas"><font style="font-size: 9.5pt">&#160;</font></font></span></p>  <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"><span style="font-family: "><font face="Consolas"><font style="font-size: 9.5pt">&#160;</font></font></span></p>  <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"><font face="Consolas"><span style="font-family: ; color: "><font color="#0000ff"><font style="font-size: 9.5pt">create</font></font></span><span style="font-family: "><font style="font-size: 9.5pt"> <span style="color: "><font color="#0000ff">symmetric</font></span> <span style="color: "><font color="#0000ff">key</font></span> <span style="color: "><font color="#008080">Man1Key</font></span> <span style="color: "><font color="#0000ff">authorization</font></span> <span style="color: "><font color="#008080">Man1</font></span> <span style="color: "><font color="#0000ff">with</font></span> <span style="color: "><font color="#0000ff">algorithm</font></span> <span style="color: "><font color="#808080">=</font></span> <span style="color: "><font color="#0000ff">TRIPLE_DES</font></span> <span style="color: "><font color="#0000ff">ENCRYPTION</font></span> <span style="color: "><font color="#0000ff">BY</font></span> <span style="color: "><font color="#0000ff">certificate</font></span> </font><span style="color: "><font style="font-size: 9.5pt" color="#008080">Man1Cert</font></span></span></font></p>  <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"><span style="font-family: ; color: "><font face="Consolas"><font style="font-size: 9.5pt" color="#0000ff">go</font></font></span><span style="font-family: "></span></p>  <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"><span style="font-family: "><font face="Consolas"><font style="font-size: 9.5pt">&#160;</font></font></span></p>  <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"><font face="Consolas"><span style="font-family: ; color: "><font color="#0000ff"><font style="font-size: 9.5pt">create</font></font></span><span style="font-family: "><font style="font-size: 9.5pt"> <span style="color: "><font color="#0000ff">symmetric</font></span> <span style="color: "><font color="#0000ff">key</font></span> <span style="color: "><font color="#008080">Man2Key</font></span> <span style="color: "><font color="#0000ff">authorization</font></span> <span style="color: "><font color="#008080">Man2</font></span> <span style="color: "><font color="#0000ff">with</font></span> <span style="color: "><font color="#0000ff">algorithm</font></span> <span style="color: "><font color="#808080">=</font></span> <span style="color: "><font color="#0000ff">TRIPLE_DES</font></span> <span style="color: "><font color="#0000ff">ENCRYPTION</font></span> <span style="color: "><font color="#0000ff">BY</font></span> <span style="color: "><font color="#0000ff">certificate</font></span> </font><span style="color: "><font style="font-size: 9.5pt" color="#008080">Man2Cert</font></span></span></font></p>  <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"><span style="font-family: ; color: "><font face="Consolas"><font style="font-size: 9.5pt" color="#0000ff">go</font></font></span><span style="font-family: "></span></p>  <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"><span style="font-family: "><font face="Consolas"><font style="font-size: 9.5pt">&#160;</font></font></span></p>  <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"><span style="mso-fareast-font-family: &quot;Times New Roman&quot;; mso-bidi-font-family: &quot;Times New Roman&quot;; mso-fareast-language: en-in"><font style="font-size: 12pt">Now we’ll do the encryption</font></span></p>  <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"><span style="font-family: "><font face="Consolas"><font style="font-size: 9.5pt">&#160;</font></font></span></p>  <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"><span style="font-family: "><font face="Consolas"><font style="font-size: 9.5pt">&#160;</font></font></span></p>  <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"><font face="Consolas"><span style="font-family: ; color: "><font color="#0000ff"><font style="font-size: 9.5pt">execute</font></font></span><span style="font-family: "><font style="font-size: 9.5pt"> <span style="color: "><font color="#0000ff">as</font></span> <span style="color: "><font color="#0000ff">login</font></span> <span style="color: "><font color="#808080">=</font></span> </font><span style="color: "><font style="font-size: 9.5pt" color="#ff0000">'Man1'</font></span></span></font></p>  <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"><span style="font-family: "><font face="Consolas"><font style="font-size: 9.5pt">&#160;</font></font></span></p>  <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"><font face="Consolas"><span style="font-family: ; color: "><font color="#0000ff"><font style="font-size: 9.5pt">open</font></font></span><span style="font-family: "><font style="font-size: 9.5pt"> <span style="color: "><font color="#0000ff">symmetric</font></span> <span style="color: "><font color="#0000ff">key</font></span> <span style="color: "><font color="#008080">Man1Key</font></span> <span style="color: "><font color="#0000ff">decryption</font></span> <span style="color: "><font color="#0000ff">by</font></span> <span style="color: "><font color="#0000ff">certificate</font></span> </font><span style="color: "><font style="font-size: 9.5pt" color="#008080">Man1cert</font></span></span></font></p>  <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"><span style="font-family: "><font face="Consolas"><font style="font-size: 9.5pt">&#160;</font></font></span></p>  <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"><span style="font-family: "><font face="Consolas"><font style="font-size: 9.5pt">&#160;</font></font></span></p>  <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"><font face="Consolas"><span style="font-family: ; color: "><font color="#0000ff"><font style="font-size: 9.5pt">insert</font></font></span><span style="font-family: "><font style="font-size: 9.5pt"> <span style="color: "><font color="#0000ff">into</font></span> <span style="color: "><font color="#008080">EmpTable</font></span> <span style="color: "><font color="#0000ff">values </font></span><span style="color: "><font color="#808080">(</font></span>1<span style="color: "><font color="#808080">,</font></span> <span style="color: "><font color="#ff0000">'Chris'</font></span><span style="color: "><font color="#808080">,</font></span><span style="color: "><font color="#ff0000">'Man1'</font></span><span style="color: "><font color="#808080">,</font></span> <span style="color: "><font color="#ff00ff">encryptByKey</font></span><span style="color: "><font color="#808080">(</font></span><span style="color: "><font color="#ff00ff">Key_GUID</font></span><span style="color: "><font color="#808080">(</font></span><span style="color: "><font color="#ff0000">'Man1Key'</font></span><span style="color: "><font color="#808080">),</font></span><span style="color: "><font color="#ff0000">'111-11-1111'</font></span><span style="color: "><font color="#808080">),</font></span> <span style="color: "><font color="#ff00ff">encryptByKey</font></span><span style="color: "><font color="#808080">(</font></span><span style="color: "><font color="#ff00ff">Key_GUID</font></span><span style="color: "><font color="#808080">(</font></span><span style="color: "><font color="#ff0000">'Man1Key'</font></span><span style="color: "><font color="#808080">),</font></span><span style="color: "><font color="#ff0000">'Exceeded Expectations'</font></span></font><span style="color: "><font style="font-size: 9.5pt" color="#808080">))</font></span></span></font></p>  <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"><font face="Consolas"><span style="font-family: ; color: "><font color="#0000ff"><font style="font-size: 9.5pt">insert</font></font></span><span style="font-family: "><font style="font-size: 9.5pt"> <span style="color: "><font color="#0000ff">into</font></span> <span style="color: "><font color="#008080">EmpTable</font></span> <span style="color: "><font color="#0000ff">values </font></span><span style="color: "><font color="#808080">(</font></span>2<span style="color: "><font color="#808080">,</font></span> <span style="color: "><font color="#ff0000">'Charles'</font></span><span style="color: "><font color="#808080">,</font></span><span style="color: "><font color="#ff0000">'Man1'</font></span><span style="color: "><font color="#808080">,</font></span> <span style="color: "><font color="#ff00ff">encryptByKey</font></span><span style="color: "><font color="#808080">(</font></span><span style="color: "><font color="#ff00ff">Key_GUID</font></span><span style="color: "><font color="#808080">(</font></span><span style="color: "><font color="#ff0000">'Man1Key'</font></span><span style="color: "><font color="#808080">),</font></span><span style="color: "><font color="#ff0000">'222-22-2222'</font></span><span style="color: "><font color="#808080">),</font></span> <span style="color: "><font color="#ff00ff">encryptByKey</font></span><span style="color: "><font color="#808080">(</font></span><span style="color: "><font color="#ff00ff">Key_GUID</font></span><span style="color: "><font color="#808080">(</font></span><span style="color: "><font color="#ff0000">'Man1Key'</font></span><span style="color: "><font color="#808080">),</font></span><span style="color: "><font color="#ff0000">'Met Expectations’</font></span></font><span style="color: "><font style="font-size: 9.5pt" color="#808080">))</font></span></span></font></p>  <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"><font face="Consolas"><span style="font-family: ; color: "><font color="#0000ff"><font style="font-size: 9.5pt">insert</font></font></span><span style="font-family: "><font style="font-size: 9.5pt"> <span style="color: "><font color="#0000ff">into</font></span> <span style="color: "><font color="#008080">EmpTable</font></span> <span style="color: "><font color="#0000ff">values </font></span><span style="color: "><font color="#808080">(</font></span>3<span style="color: "><font color="#808080">,</font></span> <span style="color: "><font color="#ff0000">'James'</font></span><span style="color: "><font color="#808080">,</font></span><span style="color: "><font color="#ff0000">'Man1'</font></span><span style="color: "><font color="#808080">,</font></span> <span style="color: "><font color="#ff00ff">encryptByKey</font></span><span style="color: "><font color="#808080">(</font></span><span style="color: "><font color="#ff00ff">Key_GUID</font></span><span style="color: "><font color="#808080">(</font></span><span style="color: "><font color="#ff0000">'Man1Key'</font></span><span style="color: "><font color="#808080">),</font></span><span style="color: "><font color="#ff0000">'333-33-3333'</font></span><span style="color: "><font color="#808080">),</font></span> <span style="color: "><font color="#ff00ff">encryptByKey</font></span><span style="color: "><font color="#808080">(</font></span><span style="color: "><font color="#ff00ff">Key_GUID</font></span><span style="color: "><font color="#808080">(</font></span><span style="color: "><font color="#ff0000">'Man1Key'</font></span><span style="color: "><font color="#808080">),</font></span><span style="color: "><font color="#ff0000">'Partially Met Expectations'</font></span></font><span style="color: "><font style="font-size: 9.5pt" color="#808080">))</font></span></span></font></p>  <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"><span style="font-family: "><font face="Consolas"><font style="font-size: 9.5pt">&#160;</font></font></span></p>  <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"><font face="Consolas"><span style="font-family: ; color: "><font color="#0000ff"><font style="font-size: 9.5pt">close</font></font></span><span style="font-family: "><font style="font-size: 9.5pt"> <span style="color: "><font color="#808080">all</font></span> <span style="color: "><font color="#0000ff">symmetric</font></span> </font><span style="color: "><font style="font-size: 9.5pt" color="#008080">keys</font></span></span></font></p>  <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"><span style="font-family: "><font face="Consolas"><font style="font-size: 9.5pt">&#160;</font></font></span></p>  <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"><span style="font-family: ; color: "><font face="Consolas"><font style="font-size: 9.5pt" color="#0000ff">Revert</font></font></span><span style="font-family: "></span></p>  <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"><span style="font-family: "><font face="Consolas"><font style="font-size: 9.5pt">&#160;</font></font></span></p>  <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"><font face="Consolas"><span style="font-family: ; color: "><font color="#0000ff"><font style="font-size: 9.5pt">execute</font></font></span><span style="font-family: "><font style="font-size: 9.5pt"> <span style="color: "><font color="#0000ff">as</font></span> <span style="color: "><font color="#0000ff">login</font></span> <span style="color: "><font color="#808080">=</font></span> </font><span style="color: "><font style="font-size: 9.5pt" color="#ff0000">'Man2'</font></span></span></font></p>  <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"><span style="font-family: "><font face="Consolas"><font style="font-size: 9.5pt">&#160;</font></font></span></p>  <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"><font face="Consolas"><span style="font-family: ; color: "><font color="#0000ff"><font style="font-size: 9.5pt">open</font></font></span><span style="font-family: "><font style="font-size: 9.5pt"> <span style="color: "><font color="#0000ff">symmetric</font></span> <span style="color: "><font color="#0000ff">key</font></span> <span style="color: "><font color="#008080">Man2Key</font></span> <span style="color: "><font color="#0000ff">decryption</font></span> <span style="color: "><font color="#0000ff">by</font></span> <span style="color: "><font color="#0000ff">certificate</font></span> </font><span style="color: "><font style="font-size: 9.5pt" color="#008080">Man2cert</font></span></span></font></p>  <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"><span style="font-family: "><font face="Consolas"><font style="font-size: 9.5pt">&#160;</font></font></span></p>  <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"><font face="Consolas"><span style="font-family: ; color: "><font color="#0000ff"><font style="font-size: 9.5pt">insert</font></font></span><span style="font-family: "><font style="font-size: 9.5pt"> <span style="color: "><font color="#0000ff">into</font></span> <span style="color: "><font color="#008080">EmpTable</font></span> <span style="color: "><font color="#0000ff">values </font></span><span style="color: "><font color="#808080">(</font></span>991<span style="color: "><font color="#808080">,</font></span> <span style="color: "><font color="#ff0000">'Dave'</font></span><span style="color: "><font color="#808080">,</font></span><span style="color: "><font color="#ff0000">'Man2'</font></span><span style="color: "><font color="#808080">,</font></span><span style="color: "><font color="#ff00ff">encryptByKey</font></span><span style="color: "><font color="#808080">(</font></span><span style="color: "><font color="#ff00ff">Key_GUID</font></span><span style="color: "><font color="#808080">(</font></span><span style="color: "><font color="#ff0000">'Man2Key'</font></span><span style="color: "><font color="#808080">),</font></span><span style="color: "><font color="#ff0000">'444-44-4444'</font></span><span style="color: "><font color="#808080">),</font></span> <span style="color: "><font color="#ff00ff">encryptByKey</font></span><span style="color: "><font color="#808080">(</font></span><span style="color: "><font color="#ff00ff">Key_GUID</font></span><span style="color: "><font color="#808080">(</font></span><span style="color: "><font color="#ff0000">'Man2Key'</font></span><span style="color: "><font color="#808080">),</font></span><span style="color: "><font color="#ff0000"> 'Partially Met Expectations'</font></span></font><span style="color: "><font style="font-size: 9.5pt" color="#808080">))</font></span></span></font></p>  <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"><font face="Consolas"><span style="font-family: ; color: "><font color="#0000ff"><font style="font-size: 9.5pt">insert</font></font></span><span style="font-family: "><font style="font-size: 9.5pt"> <span style="color: "><font color="#0000ff">into</font></span> <span style="color: "><font color="#008080">EmpTable</font></span> <span style="color: "><font color="#0000ff">values </font></span><span style="color: "><font color="#808080">(</font></span>1001<span style="color: "><font color="#808080">,</font></span> <span style="color: "><font color="#ff0000">'Dan'</font></span><span style="color: "><font color="#808080">,</font></span><span style="color: "><font color="#ff0000">'Man2'</font></span><span style="color: "><font color="#808080">,</font></span><span style="color: "><font color="#ff00ff">encryptByKey</font></span><span style="color: "><font color="#808080">(</font></span><span style="color: "><font color="#ff00ff">Key_GUID</font></span><span style="color: "><font color="#808080">(</font></span><span style="color: "><font color="#ff0000">'Man2Key'</font></span><span style="color: "><font color="#808080">),</font></span><span style="color: "><font color="#ff0000">'555-55-5555'</font></span><span style="color: "><font color="#808080">),</font></span> <span style="color: "><font color="#ff00ff">encryptByKey</font></span><span style="color: "><font color="#808080">(</font></span><span style="color: "><font color="#ff00ff">Key_GUID</font></span><span style="color: "><font color="#808080">(</font></span><span style="color: "><font color="#ff0000">'Man2Key'</font></span><span style="color: "><font color="#808080">),</font></span><span style="color: "><font color="#ff0000"> 'Exceeded Expectations'</font></span></font><span style="color: "><font style="font-size: 9.5pt" color="#808080">))</font></span></span></font></p>  <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"><font face="Consolas"><span style="font-family: ; color: "><font color="#0000ff"><font style="font-size: 9.5pt">insert</font></font></span><span style="font-family: "><font style="font-size: 9.5pt"> <span style="color: "><font color="#0000ff">into</font></span> <span style="color: "><font color="#008080">EmpTable</font></span> <span style="color: "><font color="#0000ff">values </font></span><span style="color: "><font color="#808080">(</font></span>1011<span style="color: "><font color="#808080">,</font></span> <span style="color: "><font color="#ff0000">'Steve'</font></span><span style="color: "><font color="#808080">,</font></span><span style="color: "><font color="#ff0000">'Man2'</font></span><span style="color: "><font color="#808080">,</font></span> <span style="color: "><font color="#ff00ff">encryptByKey</font></span><span style="color: "><font color="#808080">(</font></span><span style="color: "><font color="#ff00ff">Key_GUID</font></span><span style="color: "><font color="#808080">(</font></span><span style="color: "><font color="#ff0000">'Man2Key'</font></span><span style="color: "><font color="#808080">),</font></span><span style="color: "><font color="#ff0000">'666-66-6666'</font></span><span style="color: "><font color="#808080">),</font></span> <span style="color: "><font color="#ff00ff">encryptByKey</font></span><span style="color: "><font color="#808080">(</font></span><span style="color: "><font color="#ff00ff">Key_GUID</font></span><span style="color: "><font color="#808080">(</font></span><span style="color: "><font color="#ff0000">'Man2Key'</font></span><span style="color: "><font color="#808080">),</font></span><span style="color: "><font color="#ff0000"> 'Exceeded Expectations'</font></span></font><span style="color: "><font style="font-size: 9.5pt" color="#808080">))</font></span></span></font></p>  <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"><span style="font-family: "><font face="Consolas"><font style="font-size: 9.5pt">&#160;</font></font></span></p>  <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"><font face="Consolas"><span style="font-family: ; color: "><font color="#0000ff"><font style="font-size: 9.5pt">close</font></font></span><span style="font-family: "><font style="font-size: 9.5pt"> <span style="color: "><font color="#808080">all</font></span> <span style="color: "><font color="#0000ff">symmetric</font></span> </font><span style="color: "><font style="font-size: 9.5pt" color="#008080">keys</font></span></span></font></p>  <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"><span style="font-family: "><font face="Consolas"><font style="font-size: 9.5pt">&#160;</font></font></span></p>  <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"><span style="font-family: ; color: "><font face="Consolas"><font style="font-size: 9.5pt" color="#0000ff">revert</font></font></span></p>  <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"><span style="font-family: "><font face="Consolas"><font style="font-size: 9.5pt">&#160;</font></font></span></p>  <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"><span style="font-family: "><font face="Consolas"><font style="font-size: 9.5pt">&#160;</font></font></span></p>  <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"><span style="mso-fareast-font-family: &quot;Times New Roman&quot;; mso-bidi-font-family: &quot;Times New Roman&quot;; mso-fareast-language: en-in"><font style="font-size: 12pt">If we try to select the data from these two columns which contain encrypted data, it looks like</font></span></p>  <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"><span style="font-family: "><font face="Consolas"><font style="font-size: 9.5pt">&#160;</font></font></span></p>  <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"><font face="Consolas"><span style="font-family: ; color: "><font color="#0000ff"><font style="font-size: 9.5pt">select</font></font></span><span style="font-family: "><font style="font-size: 9.5pt"> <span style="color: "><font color="#008080">Id</font></span><span style="color: "><font color="#808080">,</font></span> <span style="color: "><font color="#008080">name</font></span><span style="color: "><font color="#808080">,</font></span> <span style="color: "><font color="#008080">Manname</font></span><span style="color: "><font color="#808080">,</font></span> <span style="color: "><font color="#ff00ff">convert</font></span><span style="color: "><font color="#808080">(</font></span><span style="color: "><font color="#0000ff">varchar</font></span><span style="color: "><font color="#808080">,</font></span><span style="color: "><font color="#ff00ff">decryptbykey</font></span><span style="color: "><font color="#808080">(</font></span><span style="color: "><font color="#008080">SSN</font></span><span style="color: "><font color="#808080">))</font></span> <span style="color: "><font color="#0000ff">as</font></span> <span style="color: "><font color="#008080">SSN</font></span><span style="color: "><font color="#808080">,</font></span> <span style="color: "><font color="#ff00ff">convert</font></span><span style="color: "><font color="#0000ff"> </font></span><span style="color: "><font color="#808080">(</font></span><span style="color: "><font color="#0000ff">varchar</font></span><span style="color: "><font color="#808080">,</font></span><span style="color: "><font color="#ff00ff">decryptbykey</font></span><span style="color: "><font color="#808080">(</font></span><span style="color: "><font color="#008080">Rating</font></span><span style="color: "><font color="#808080">))</font></span> <span style="color: "><font color="#0000ff">as</font></span> <span style="color: "><font color="#008080">Rating</font></span> <span style="color: "><font color="#0000ff">from</font></span> </font><span style="color: "><font style="font-size: 9.5pt" color="#008080">EmpTable</font></span></span></font></p>  <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"><span style="font-family: "><font face="Consolas"><font style="font-size: 9.5pt">&#160;</font></font></span></p>  <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"><span style="font-family: "><font face="Consolas"><font style="font-size: 9.5pt">Id<span style="mso-tab-count: 1">&#160;&#160;&#160;&#160; </span>name<span style="mso-tab-count: 1">&#160;&#160; </span>Manname SSN<span style="mso-tab-count: 1">&#160;&#160;&#160; </span>Rating</font></font></span></p>  <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"><span style="font-family: "><font face="Consolas"><font style="font-size: 9.5pt">1<span style="mso-tab-count: 1">&#160;&#160;&#160;&#160;&#160; </span>Chris&#160; Man1<span style="mso-tab-count: 1">&#160;&#160; </span>NULL<span style="mso-tab-count: 1">&#160;&#160; </span>NULL</font></font></span></p>  <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"><span style="font-family: "><font face="Consolas"><font style="font-size: 9.5pt">2<span style="mso-tab-count: 1">&#160;&#160;&#160;&#160;&#160; </span>CharlesMan1<span style="mso-tab-count: 1">&#160;&#160; </span>NULL<span style="mso-tab-count: 1">&#160;&#160; </span>NULL</font></font></span></p>  <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"><span style="font-family: "><font face="Consolas"><font style="font-size: 9.5pt">3<span style="mso-tab-count: 1">&#160;&#160;&#160;&#160;&#160; </span>James<span style="mso-tab-count: 1">&#160; </span>Man1<span style="mso-tab-count: 1">&#160;&#160; </span>NULL<span style="mso-tab-count: 1">&#160;&#160; </span>NULL</font></font></span></p>  <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"><span style="font-family: "><font face="Consolas"><font style="font-size: 9.5pt">4<span style="mso-tab-count: 1">&#160;&#160;&#160;&#160;&#160; </span>Dave<span style="mso-tab-count: 1">&#160;&#160; </span>Man2<span style="mso-tab-count: 1">&#160;&#160; </span>NULL<span style="mso-tab-count: 1">&#160;&#160; </span>NULL</font></font></span></p>  <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"><span style="font-family: "><font face="Consolas"><font style="font-size: 9.5pt">5<span style="mso-tab-count: 1">&#160;&#160;&#160;&#160;&#160; D</span>an&#160;&#160;&#160; Man2<span style="mso-tab-count: 1">&#160;&#160; </span>NULL<span style="mso-tab-count: 1">&#160;&#160; </span>NULL</font></font></span></p>  <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"><span style="font-family: "><font face="Consolas"><font style="font-size: 9.5pt">6<span style="mso-tab-count: 1">&#160;&#160;&#160;&#160;&#160; Steve</span><span style="mso-tab-count: 1">&#160; </span>Man2<span style="mso-tab-count: 1">&#160;&#160; </span>NULL<span style="mso-tab-count: 1">&#160;&#160; </span>NULL</font></font></span></p>  <p style="margin-left: 0in; margin-right: 0in"><span style="font-family: ; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin"><font style="font-size: 12pt">Now we’ll try to decrypt the data while querying it.</font></span></p>  <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"><span style="font-family: "><font face="Consolas"><font style="font-size: 9.5pt">&#160;</font></font></span></p>  <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"><font face="Consolas"><span style="font-family: ; color: "><font color="#0000ff"><font style="font-size: 9.5pt">execute</font></font></span><span style="font-family: "><font style="font-size: 9.5pt"> <span style="color: "><font color="#0000ff">as</font></span> <span style="color: "><font color="#0000ff">login</font></span> <span style="color: "><font color="#808080">=</font></span> </font><span style="color: "><font style="font-size: 9.5pt" color="#ff0000">'Man1'</font></span></span></font></p>  <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"><font face="Consolas"><span style="font-family: ; color: "><font color="#0000ff"><font style="font-size: 9.5pt">open</font></font></span><span style="font-family: "><font style="font-size: 9.5pt"> <span style="color: "><font color="#0000ff">symmetric</font></span> <span style="color: "><font color="#0000ff">key</font></span> <span style="color: "><font color="#008080">Man1Key</font></span> <span style="color: "><font color="#0000ff">decryption</font></span> <span style="color: "><font color="#0000ff">by</font></span> <span style="color: "><font color="#0000ff">certificate</font></span> </font><span style="color: "><font style="font-size: 9.5pt" color="#008080">Man1Cert</font></span></span></font></p>  <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"><font face="Consolas"><span style="font-family: ; color: "><font color="#0000ff"><font style="font-size: 9.5pt">select</font></font></span><span style="font-family: "><font style="font-size: 9.5pt"> <span style="color: "><font color="#008080">Id</font></span><span style="color: "><font color="#808080">,</font></span> <span style="color: "><font color="#008080">name</font></span><span style="color: "><font color="#808080">,</font></span> <span style="color: "><font color="#008080">Manname</font></span><span style="color: "><font color="#808080">,</font></span> <span style="color: "><font color="#ff00ff">convert</font></span><span style="color: "><font color="#808080">(</font></span><span style="color: "><font color="#0000ff">varchar</font></span><span style="color: "><font color="#808080">,</font></span><span style="color: "><font color="#ff00ff">decryptbykey</font></span><span style="color: "><font color="#808080">(</font></span><span style="color: "><font color="#008080">SSN</font></span><span style="color: "><font color="#808080">))</font></span> <span style="color: "><font color="#0000ff">as</font></span> <span style="color: "><font color="#008080">SSN</font></span><span style="color: "><font color="#808080">,</font></span> <span style="color: "><font color="#ff00ff">convert</font></span><span style="color: "><font color="#0000ff"> </font></span><span style="color: "><font color="#808080">(</font></span><span style="color: "><font color="#0000ff">varchar</font></span><span style="color: "><font color="#808080">,</font></span><span style="color: "><font color="#ff00ff">decryptbykey</font></span><span style="color: "><font color="#808080">(</font></span><span style="color: "><font color="#008080">Problem</font></span><span style="color: "><font color="#808080">))</font></span> <span style="color: "><font color="#0000ff">as</font></span> <span style="color: "><font color="#008080">Rating </font></span><span style="color: "><font color="#0000ff">from</font></span> </font><span style="color: "><font style="font-size: 9.5pt" color="#008080">EmpTable</font></span></span></font></p>  <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"><span style="font-family: "><font face="Consolas"><font style="font-size: 9.5pt">&#160;</font></font></span></p>  <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"><span style="font-family: "><font face="Consolas"><font style="font-size: 9.5pt">Id<span style="mso-tab-count: 1">&#160;&#160;&#160;&#160; </span>name<span style="mso-tab-count: 1">&#160;&#160; </span>Manname<span style="mso-tab-count: 1">&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span>SSN<span style="mso-tab-count: 1">&#160;&#160;&#160; </span><span style="mso-tab-count: 1">&#160;&#160;&#160;&#160;&#160;&#160; </span>Rating</font></font></span></p>  <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"><span style="font-family: "><font face="Consolas"><font style="font-size: 9.5pt">1<span style="mso-tab-count: 1">&#160;&#160;&#160;&#160;&#160; Chris</span><span style="mso-tab-count: 1">&#160;&#160; </span>Man1<span style="mso-tab-count: 1">&#160;&#160; </span><span style="mso-tab-count: 1">&#160;&#160;&#160;&#160;&#160;&#160; </span>111-11-1111<span style="mso-tab-count: 1">&#160;&#160; </span>Exceeded Expectations</font></font></span></p>  <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"><span style="font-family: "><font face="Consolas"><font style="font-size: 9.5pt">2<span style="mso-tab-count: 1">&#160;&#160;&#160;&#160;&#160; Charles</span><span style="mso-tab-count: 1"> </span>Man1<span style="mso-tab-count: 1">&#160;&#160; </span><span style="mso-tab-count: 1">&#160;&#160;&#160;&#160;&#160;&#160; </span>222-22-2222<span style="mso-tab-count: 1">&#160;&#160; </span>Met Expectations</font></font></span></p>  <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"><span style="font-family: "><font face="Consolas"><font style="font-size: 9.5pt">3<span style="mso-tab-count: 1">&#160;&#160;&#160;&#160;&#160; </span>James<span style="mso-tab-count: 1">&#160;&#160; </span>Man1<span style="mso-tab-count: 1">&#160;&#160; </span><span style="mso-tab-count: 1">&#160;&#160;&#160;&#160;&#160;&#160; </span>333-33-3333<span style="mso-tab-count: 1">&#160;&#160; </span>Partially Met Expectations</font></font></span></p>  <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"><span style="font-family: "><font face="Consolas"><font style="font-size: 9.5pt">4<span style="mso-tab-count: 1">&#160;&#160;&#160;&#160;&#160; </span>Dave<span style="mso-tab-count: 1">&#160;&#160;&#160; </span>Man2<span style="mso-tab-count: 1">&#160;&#160; </span><span style="mso-tab-count: 1">&#160;&#160;&#160;&#160;&#160;&#160; </span>NULL<span style="mso-tab-count: 1">&#160;&#160; </span><span style="mso-tab-count: 1">&#160;&#160;&#160;&#160;&#160;&#160; </span>NULL</font></font></span></p>  <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"><span style="font-family: "><font face="Consolas"><font style="font-size: 9.5pt">5<span style="mso-tab-count: 1">&#160;&#160;&#160;&#160;&#160; D</span>an&#160;&#160;&#160;&#160; Man2<span style="mso-tab-count: 1">&#160;&#160; </span><span style="mso-tab-count: 1">&#160;&#160;&#160;&#160;&#160;&#160; </span>NULL<span style="mso-tab-count: 1">&#160;&#160; </span><span style="mso-tab-count: 1">&#160;&#160;&#160;&#160;&#160;&#160; </span>NULL</font></font></span></p>  <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"><span style="font-family: "><font face="Consolas"><font style="font-size: 9.5pt">6<span style="mso-tab-count: 1">&#160;&#160;&#160;&#160;&#160; Steve</span><span style="mso-tab-count: 1">&#160;&#160; </span>Man2<span style="mso-tab-count: 1">&#160;&#160; </span><span style="mso-tab-count: 1">&#160;&#160;&#160;&#160;&#160;&#160; </span>NULL<span style="mso-tab-count: 1">&#160;&#160; </span><span style="mso-tab-count: 1">&#160;&#160;&#160;&#160;&#160;&#160; </span>NULL</font></font></span></p>  <p style="margin-left: 0in; margin-right: 0in"><span style="font-family: ; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin"><font style="font-size: 12pt">&#160;</font></span></p>  <p class="MsoNormal" style="margin: 0in 0in 8pt; line-height: 12pt">If we observe the user1 is seeing NULLs for the data rows that were encrypted by user2</p>  <p class="MsoNormal" style="margin: 0in 0in 8pt; line-height: 12pt">Now we’re not closing the key opened and trying to see the data as user2</p>  <p class="MsoNormal" style="margin: 0in 0in 8pt; line-height: 12pt">&#160;</p>  <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"><span style="font-family: ; color: "><font face="Consolas"><font style="font-size: 9.5pt" color="#0000ff">revert</font></font></span><span style="font-family: "></span></p>  <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"><font face="Consolas"><span style="font-family: ; color: "><font color="#0000ff"><font style="font-size: 9.5pt">execute</font></font></span><span style="font-family: "><font style="font-size: 9.5pt"> <span style="color: "><font color="#0000ff">as</font></span> <span style="color: "><font color="#0000ff">login</font></span> <span style="color: "><font color="#808080">=</font></span> </font><span style="color: "><font style="font-size: 9.5pt" color="#ff0000">'Man2'</font></span></span></font></p>  <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"><font face="Consolas"><span style="font-family: ; color: "><font color="#0000ff"><font style="font-size: 9.5pt">select</font></font></span><span style="font-family: "><font style="font-size: 9.5pt"> <span style="color: "><font color="#008080">Id</font></span><span style="color: "><font color="#808080">,</font></span> <span style="color: "><font color="#008080">name</font></span><span style="color: "><font color="#808080">,</font></span> <span style="color: "><font color="#008080">Manname</font></span><span style="color: "><font color="#808080">,</font></span> <span style="color: "><font color="#ff00ff">convert</font></span><span style="color: "><font color="#808080">(</font></span><span style="color: "><font color="#0000ff">varchar</font></span><span style="color: "><font color="#808080">,</font></span><span style="color: "><font color="#ff00ff">decryptbykey</font></span><span style="color: "><font color="#808080">(</font></span><span style="color: "><font color="#008080">SSN</font></span><span style="color: "><font color="#808080">))</font></span> <span style="color: "><font color="#0000ff">as</font></span> <span style="color: "><font color="#008080">SSN</font></span><span style="color: "><font color="#808080">,</font></span> <span style="color: "><font color="#ff00ff">convert</font></span><span style="color: "><font color="#0000ff"> </font></span><span style="color: "><font color="#808080">(</font></span><span style="color: "><font color="#0000ff">varchar</font></span><span style="color: "><font color="#808080">,</font></span><span style="color: "><font color="#ff00ff">decryptbykey</font></span><span style="color: "><font color="#808080">(</font></span><span style="color: "><font color="#008080">Problem</font></span><span style="color: "><font color="#808080">))</font></span> <span style="color: "><font color="#0000ff">as</font></span> <span style="color: "><font color="#008080">Rating </font></span><span style="color: "><font color="#0000ff">from</font></span> </font><span style="color: "><font style="font-size: 9.5pt" color="#008080">EmpTable</font></span></span></font></p>  <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"><span style="font-family: "><font face="Consolas"><font style="font-size: 9.5pt">&#160;</font></font></span></p>  <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"><span style="font-family: "><font face="Consolas"><font style="font-size: 9.5pt">Id<span style="mso-tab-count: 1">&#160;&#160;&#160;&#160; </span>name<span style="mso-tab-count: 1">&#160;&#160; </span>Manname<span style="mso-tab-count: 1">&#160;&#160;&#160;&#160;&#160;&#160; </span>SSN<span style="mso-tab-count: 1">&#160;&#160;&#160; </span><span style="mso-tab-count: 1">&#160;&#160;&#160;&#160;&#160;&#160; </span>Rating</font></font></span></p>  <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"><span style="font-family: "><font face="Consolas"><font style="font-size: 9.5pt">1<span style="mso-tab-count: 1">&#160;&#160;&#160;&#160;&#160; </span>Chris&#160; Man1<span style="mso-tab-count: 1">&#160;&#160; </span><span style="mso-tab-count: 1">&#160;&#160;&#160;&#160;&#160;&#160; </span>111-11-1111<span style="mso-tab-count: 1">&#160;&#160; </span>Exceeded Expectations</font></font></span></p>  <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"><span style="font-family: "><font face="Consolas"><font style="font-size: 9.5pt">2<span style="mso-tab-count: 1">&#160;&#160;&#160;&#160;&#160; </span>CharlesMan1<span style="mso-tab-count: 1">&#160;&#160; </span><span style="mso-tab-count: 1">&#160;&#160;&#160;&#160;&#160;&#160; </span>222-22-2222<span style="mso-tab-count: 1">&#160;&#160; </span>Met Expectations</font></font></span></p>  <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"><span style="font-family: "><font face="Consolas"><font style="font-size: 9.5pt">3<span style="mso-tab-count: 1">&#160;&#160;&#160;&#160;&#160; </span>James<span style="mso-tab-count: 1">&#160; </span>Man1<span style="mso-tab-count: 1">&#160;&#160; </span><span style="mso-tab-count: 1">&#160;&#160;&#160;&#160;&#160;&#160; </span>333-33-3333<span style="mso-tab-count: 1">&#160;&#160; </span>Partially Met Expectations</font></font></span></p>  <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"><span style="font-family: "><font face="Consolas"><font style="font-size: 9.5pt">4<span style="mso-tab-count: 1">&#160;&#160;&#160;&#160;&#160; </span>Dave<span style="mso-tab-count: 1">&#160;&#160; </span>Man2<span style="mso-tab-count: 1">&#160;&#160; </span><span style="mso-tab-count: 1">&#160;&#160;&#160;&#160;&#160;&#160; </span>NULL<span style="mso-tab-count: 1">&#160;&#160; </span><span style="mso-tab-count: 1">&#160;&#160;&#160;&#160;&#160;&#160; </span>NULL</font></font></span></p>  <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"><span style="font-family: "><font face="Consolas"><font style="font-size: 9.5pt">5<span style="mso-tab-count: 1">&#160;&#160;&#160;&#160;&#160; </span>Dan&#160;&#160;&#160; Man2<span style="mso-tab-count: 1">&#160;&#160; </span><span style="mso-tab-count: 1">&#160;&#160;&#160;&#160;&#160;&#160; </span>NULL<span style="mso-tab-count: 1">&#160;&#160; </span><span style="mso-tab-count: 1">&#160;&#160;&#160;&#160;&#160;&#160; </span>NULL</font></font></span></p>  <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"><span style="font-family: "><font face="Consolas"><font style="font-size: 9.5pt">6<span style="mso-tab-count: 1">&#160;&#160;&#160;&#160;&#160; Steve</span><span style="mso-tab-count: 1">&#160; </span>Man2<span style="mso-tab-count: 1">&#160;&#160; </span><span style="mso-tab-count: 1">&#160;&#160;&#160;&#160;&#160;&#160; </span>NULL<span style="mso-tab-count: 1">&#160;&#160; </span><span style="mso-tab-count: 1">&#160;&#160;&#160;&#160;&#160;&#160; </span>NULL</font></font></span></p>  <p class="MsoNormal" style="margin: 0in 0in 8pt; line-height: 12pt">&#160;</p>  <p class="MsoNormal" style="margin: 0in 0in 8pt; line-height: 12pt">So, user2 is able to see the data that was encrypted by user1.</p>  <p class="MsoNormal" style="margin: 0in 0in 8pt; line-height: 12pt">This is because, the keys that is required to decrypt this data is still open. And even though the login Doc 2 does not have the permission can still see the data that was encrypted using the Man1’s keys. This is only possible on the same session with impersonation. </p>  <p class="MsoNormal" style="margin: 0in 0in 8pt; line-height: 12pt"><span style="mso-spacerun: yes">&#160;</span>The query processor don’t validate if the owner of the key or the user who encrypted the data is doing the decryption or not. i.e. if a key, protecting the data/used to encrypt the data is open, whoever issues a select query against the encrypted columns will get the data in decrypted form, in the same session.</p>  <p class="MsoNormal" style="margin: 0in 0in 8pt; line-height: 12pt">The point here is that when the keys are opened in a session and if there is a login or user where the caller <span lang="EN" style="mso-ansi-language: en">has IMPERSONATE permissions on the another login/User, and if he changes the execution context to the new login, which really does not have permissions on the keys used for encryption, will still be able to see the data if the keys were not closed before changing the context. As in the above example. </span></p>  <p class="MsoNormal" style="margin: 0in 0in 8pt; line-height: 12pt"><span lang="EN" style="mso-ansi-language: en">The better way of changing the execution context in such cases where you do not want the data to be read would be to close the keys and then change the execution context as shown below:</span></p>  <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"><font face="Consolas"><span style="font-family: ; color: "><font color="#0000ff"><font style="font-size: 9.5pt">execute</font></font></span><span style="font-family: "><font style="font-size: 9.5pt"> <span style="color: "><font color="#0000ff">as</font></span> <span style="color: "><font color="#0000ff">login</font></span> <span style="color: "><font color="#808080">=</font></span> </font><span style="color: "><font style="font-size: 9.5pt" color="#ff0000">'Man1'</font></span></span></font></p>  <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"><font face="Consolas"><span style="font-family: ; color: "><font color="#0000ff"><font style="font-size: 9.5pt">open</font></font></span><span style="font-family: "><font style="font-size: 9.5pt"> <span style="color: "><font color="#0000ff">symmetric</font></span> <span style="color: "><font color="#0000ff">key</font></span> <span style="color: "><font color="#008080">Man1Key</font></span> <span style="color: "><font color="#0000ff">decryption</font></span> <span style="color: "><font color="#0000ff">by</font></span> <span style="color: "><font color="#0000ff">certificate</font></span> </font><span style="color: "><font style="font-size: 9.5pt" color="#008080">Man1Cert</font></span></span></font></p>  <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"><font face="Consolas"><span style="font-family: ; color: "><font color="#0000ff"><font style="font-size: 9.5pt">select</font></font></span><span style="font-family: "><font style="font-size: 9.5pt"> <span style="color: "><font color="#008080">Id</font></span><span style="color: "><font color="#808080">,</font></span> <span style="color: "><font color="#008080">name</font></span><span style="color: "><font color="#808080">,</font></span> <span style="color: "><font color="#008080">Manname</font></span><span style="color: "><font color="#808080">,</font></span> <span style="color: "><font color="#ff00ff">convert</font></span><span style="color: "><font color="#808080">(</font></span><span style="color: "><font color="#0000ff">varchar</font></span><span style="color: "><font color="#808080">,</font></span><span style="color: "><font color="#ff00ff">decryptbykey</font></span><span style="color: "><font color="#808080">(</font></span><span style="color: "><font color="#008080">SSN</font></span><span style="color: "><font color="#808080">))</font></span> <span style="color: "><font color="#0000ff">as</font></span> <span style="color: "><font color="#008080">SSN</font></span><span style="color: "><font color="#808080">,</font></span> <span style="color: "><font color="#ff00ff">convert</font></span><span style="color: "><font color="#0000ff"> </font></span><span style="color: "><font color="#808080">(</font></span><span style="color: "><font color="#0000ff">varchar</font></span><span style="color: "><font color="#808080">,</font></span><span style="color: "><font color="#ff00ff">decryptbykey</font></span><span style="color: "><font color="#808080">(</font></span><span style="color: "><font color="#008080">Problem</font></span><span style="color: "><font color="#808080">))</font></span> <span style="color: "><font color="#0000ff">as</font></span> <span style="color: "><font color="#008080">Rating </font></span><span style="color: "><font color="#0000ff">from</font></span> </font><span style="color: "><font style="font-size: 9.5pt" color="#008080">EmpTable</font></span></span></font></p>  <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"><span style="font-family: "><font face="Consolas"><font style="font-size: 9.5pt">&#160;</font></font></span></p>  <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"><span style="font-family: "><font face="Consolas"><font style="font-size: 9.5pt">Id<span style="mso-tab-count: 1">&#160;&#160;&#160;&#160; </span>name<span style="mso-tab-count: 1">&#160;&#160; </span>Manname<span style="mso-tab-count: 1">&#160;&#160;&#160;&#160;&#160;&#160; </span>SSN<span style="mso-tab-count: 1">&#160;&#160;&#160; </span><span style="mso-tab-count: 1">&#160;&#160;&#160;&#160;&#160;&#160; </span>Rating</font></font></span></p>  <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"><span style="font-family: "><font face="Consolas"><font style="font-size: 9.5pt">1<span style="mso-tab-count: 1">&#160;&#160;&#160;&#160;&#160; </span>Chris&#160; Man1<span style="mso-tab-count: 1">&#160;&#160; </span><span style="mso-tab-count: 1">&#160;&#160;&#160;&#160;&#160;&#160; </span>111-11-1111<span style="mso-tab-count: 1">&#160;&#160; </span>Exceeded Expectations</font></font></span></p>  <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"><span style="font-family: "><font face="Consolas"><font style="font-size: 9.5pt">2<span style="mso-tab-count: 1">&#160;&#160;&#160;&#160;&#160; </span>CharlesMan1<span style="mso-tab-count: 1">&#160;&#160; </span><span style="mso-tab-count: 1">&#160;&#160;&#160;&#160;&#160;&#160; </span>222-22-2222<span style="mso-tab-count: 1">&#160;&#160; </span>Met Expectations</font></font></span></p>  <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"><span style="font-family: "><font face="Consolas"><font style="font-size: 9.5pt">3<span style="mso-tab-count: 1">&#160;&#160;&#160;&#160;&#160; </span>James<span style="mso-tab-count: 1">&#160; </span>Man1<span style="mso-tab-count: 1">&#160;&#160; </span><span style="mso-tab-count: 1">&#160;&#160;&#160;&#160;&#160;&#160; </span>333-33-3333<span style="mso-tab-count: 1">&#160;&#160; </span>Partially Met Expectations</font></font></span></p>  <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"><span style="font-family: "><font face="Consolas"><font style="font-size: 9.5pt">4<span style="mso-tab-count: 1">&#160;&#160;&#160;&#160;&#160; </span>Dave<span style="mso-tab-count: 1">&#160;&#160; </span>Man2<span style="mso-tab-count: 1">&#160;&#160; </span><span style="mso-tab-count: 1">&#160;&#160;&#160;&#160;&#160;&#160; </span>NULL<span style="mso-tab-count: 1">&#160;&#160; </span><span style="mso-tab-count: 1">&#160;&#160;&#160;&#160;&#160;&#160; </span>NULL</font></font></span></p>  <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"><span style="font-family: "><font face="Consolas"><font style="font-size: 9.5pt">5<span style="mso-tab-count: 1">&#160;&#160;&#160;&#160;&#160; </span>Dan&#160;&#160;&#160; Man2<span style="mso-tab-count: 1">&#160;&#160; </span><span style="mso-tab-count: 1">&#160;&#160;&#160;&#160;&#160;&#160; </span>NULL<span style="mso-tab-count: 1">&#160;&#160; </span><span style="mso-tab-count: 1">&#160;&#160;&#160;&#160;&#160;&#160; </span>NULL</font></font></span></p>  <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"><span style="font-family: "><font face="Consolas"><font style="font-size: 9.5pt">6<span style="mso-tab-count: 1">&#160;&#160;&#160;&#160;&#160; </span>Steve&#160; Man2<span style="mso-tab-count: 1">&#160;&#160; </span><span style="mso-tab-count: 1">&#160;&#160;&#160;&#160;&#160;&#160; </span>NULL<span style="mso-tab-count: 1">&#160;&#160; </span><span style="mso-tab-count: 1">&#160;&#160;&#160;&#160;&#160;&#160; </span>NULL</font></font></span></p>  <p class="MsoNormal" style="margin: 0in 0in 8pt; line-height: 12pt"><span lang="EN" style="mso-ansi-language: en">&#160;</span></p>  <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"><font face="Courier New"><span lang="EN-US" style="font-family: ; color: ; mso-ansi-language: en-us; mso-no-proof: yes"><font color="#0000ff"><font style="font-size: 10pt">close</font></font></span><span lang="EN-US" style="font-family: ; mso-ansi-language: en-us; mso-no-proof: yes"><font style="font-size: 10pt"> <span style="color: "><font color="#808080">all</font></span> <span style="color: "><font color="#0000ff">symmetric</font></span> keys</font></span></font></p>  <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"><span lang="EN-US" style="font-family: ; mso-ansi-language: en-us; mso-no-proof: yes"><font face="Courier New"><font style="font-size: 10pt">&#160;</font></font></span></p>  <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"><span style="font-family: ; color: "><font face="Consolas"><font style="font-size: 9.5pt" color="#0000ff">Revert</font></font></span></p>  <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"><span style="font-family: "><font face="Consolas"><font style="font-size: 9.5pt">&#160;</font></font></span></p>  <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"><font face="Consolas"><span style="font-family: ; color: "><font color="#0000ff"><font style="font-size: 9.5pt">execute</font></font></span><span style="font-family: "><font style="font-size: 9.5pt"> <span style="color: "><font color="#0000ff">as</font></span> <span style="color: "><font color="#0000ff">login</font></span> <span style="color: "><font color="#808080">=</font></span> </font><span style="color: "><font style="font-size: 9.5pt" color="#ff0000">'Man2'</font></span></span></font></p>  <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"><font face="Consolas"><span style="font-family: ; color: "><font color="#0000ff"><font style="font-size: 9.5pt">select</font></font></span><span style="font-family: "><font style="font-size: 9.5pt"> <span style="color: "><font color="#008080">Id</font></span><span style="color: "><font color="#808080">,</font></span> <span style="color: "><font color="#008080">name</font></span><span style="color: "><font color="#808080">,</font></span> <span style="color: "><font color="#008080">Manname</font></span><span style="color: "><font color="#808080">,</font></span> <span style="color: "><font color="#ff00ff">convert</font></span><span style="color: "><font color="#808080">(</font></span><span style="color: "><font color="#0000ff">varchar</font></span><span style="color: "><font color="#808080">,</font></span><span style="color: "><font color="#ff00ff">decryptbykey</font></span><span style="color: "><font color="#808080">(</font></span><span style="color: "><font color="#008080">SSN</font></span><span style="color: "><font color="#808080">))</font></span> <span style="color: "><font color="#0000ff">as</font></span> <span style="color: "><font color="#008080">SSN</font></span><span style="color: "><font color="#808080">,</font></span> <span style="color: "><font color="#ff00ff">convert</font></span><span style="color: "><font color="#0000ff"> </font></span><span style="color: "><font color="#808080">(</font></span><span style="color: "><font color="#0000ff">varchar</font></span><span style="color: "><font color="#808080">,</font></span><span style="color: "><font color="#ff00ff">decryptbykey</font></span><span style="color: "><font color="#808080">(</font></span><span style="color: "><font color="#008080">Problem</font></span><span style="color: "><font color="#808080">))</font></span> <span style="color: "><font color="#0000ff">as</font></span> <span style="color: "><font color="#008080">Rating </font></span><span style="color: "><font color="#0000ff">from</font></span> </font><span style="color: "><font style="font-size: 9.5pt" color="#008080">EmpTable</font></span></span></font></p>  <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"><span style="font-family: "><font face="Consolas"><font style="font-size: 9.5pt">&#160;</font></font></span></p>  <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"><span style="font-family: "><font face="Consolas"><font style="font-size: 9.5pt">Id<span style="mso-spacerun: yes">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span>name<span style="mso-spacerun: yes">&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span>Manname<span style="mso-spacerun: yes">&#160;&#160;&#160; </span>SSN<span style="mso-spacerun: yes">&#160;&#160;&#160;&#160;&#160; </span>Rating</font></font></span></p>  <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"><span style="font-family: "><font face="Consolas"><font style="font-size: 9.5pt">----------- ----------- ---------- -------- -----------</font></font></span></p>  <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"><span style="font-family: "><font face="Consolas"><font style="font-size: 9.5pt">1<span style="mso-spacerun: yes">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span>Chris&#160;&#160;&#160;&#160;&#160;&#160; Man1<span style="mso-spacerun: yes">&#160;&#160;&#160;&#160;&#160;&#160; </span>NULL<span style="mso-spacerun: yes">&#160;&#160;&#160;&#160; </span>NULL</font></font></span></p>  <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"><span style="font-family: "><font face="Consolas"><font style="font-size: 9.5pt">2<span style="mso-spacerun: yes">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span>Charles&#160;&#160;&#160;&#160; Man1<span style="mso-spacerun: yes">&#160;&#160;&#160;&#160;&#160;&#160; </span>NULL<span style="mso-spacerun: yes">&#160;&#160;&#160;&#160; </span>NULL</font></font></span></p>  <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"><span style="font-family: "><font face="Consolas"><font style="font-size: 9.5pt">3<span style="mso-spacerun: yes">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span>James<span style="mso-spacerun: yes">&#160;&#160;&#160;&#160;&#160;&#160; </span>Man1<span style="mso-spacerun: yes">&#160;&#160;&#160;&#160;&#160;&#160; </span>NULL<span style="mso-spacerun: yes">&#160;&#160;&#160;&#160; </span>NULL</font></font></span></p>  <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"><span style="font-family: "><font face="Consolas"><font style="font-size: 9.5pt">991<span style="mso-spacerun: yes">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span>Dave<span style="mso-spacerun: yes">&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span>Man2<span style="mso-spacerun: yes">&#160;&#160;&#160;&#160;&#160;&#160; </span>NULL<span style="mso-spacerun: yes">&#160;&#160;&#160;&#160; </span>NULL</font></font></span></p>  <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"><span style="font-family: "><font face="Consolas"><font style="font-size: 9.5pt">1001<span style="mso-spacerun: yes">&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span>Dan&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Man2<span style="mso-spacerun: yes">&#160;&#160;&#160;&#160;&#160;&#160; </span>NULL<span style="mso-spacerun: yes">&#160;&#160;&#160;&#160; </span>NULL</font></font></span></p>  <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"><span style="font-family: "><font face="Consolas"><font style="font-size: 9.5pt">1011<span style="mso-spacerun: yes">&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span>Steve&#160;&#160;&#160;&#160;&#160;&#160; Man2<span style="mso-spacerun: yes">&#160;&#160;&#160;&#160;&#160;&#160; </span>NULL<span style="mso-spacerun: yes">&#160;&#160;&#160;&#160; </span>NULL</font></font></span></p>  <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none"><span style="font-family: "><font face="Consolas"><font style="font-size: 9.5pt">(6 row(s) affected)</font></font></span></p>  <p class="MsoNormal" style="margin: 0in 0in 8pt; line-height: 12pt">&#160;</p>  <p class="MsoNormal" style="margin: 0in 0in 8pt; line-height: 12pt">So it’s always suggestible to close your keys after reading the data, especially in the environments where same session’s state is shared by multiple client connections/users.</p>  <p class="MsoNormal" style="margin: 0in 0in 8pt; line-height: 12pt">p.s. This feature is also useful in cases where a user want to share some/all of his data with the other users. For e.g. Manager1 want to share some/all of his employee’s details with other Managers. In this case instead of sharing his keys to those guys, he can just open his key and can allow others to read data from his session. He can close his key after the other guys completed querying the data.</p>  <p class="MsoNormal" style="margin: 0in 0in 8pt; line-height: 12pt">&#160;</p>  <p>As always, please feel free to get in touch with me with your comments or feedback.</p>  <p>Thanks,</p>  <p>Chandra</p>]]></content:encoded>
    </item>
    <item>
      <title>How to store the SQLBPA recommendations in a SQL database to make more use out of the recommendations data</title>
      <link>https://docs.microsoft.com/archive/blogs/sql_scratchpad/how-to-store-the-sqlbpa-recommendations-in-a-sql-database-to-make-more-use-out-of-the-recommendations-data</link>
      <pubDate>Mon, 17 Mar 2014 06:06:01 GMT</pubDate>
      <dc:creator><![CDATA[Chandra550]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/sql_scratchpad/2014/03/17/how-to-store-the-sqlbpa-recommendations-in-a-sql-database-to-make-more-use-out-of-the-recommendations-data/</guid>
      <description><![CDATA[Lot of us use SQL Best Practices Analyzer (BPA) to detect any potential errors, warnings,...]]></description>
      <content:encoded><![CDATA[<p><font size="2" face="Calibri">Lot of us use SQL Best Practices Analyzer (BPA) to detect any potential errors, warnings, recommendations in your environment. It’s not possible to go through every item and fix it on the BPA GUI instantly. So we need a mechanism to export that data somewhere for future reference, so that we can fix the items one by one and can ignore the ones which are not really required in our environment.</font></p>  <p><font size="2" face="Calibri">Fortunately we have an option in BPA to export the recommendation data into an XML file. But the problem here is it is very difficult for people to go through that XML (it’s very bulky) and understand that to make a good sense out of the recommendations. Some of the customers of mine expressed an idea of materializing this XML data which is very difficult to understand into relational data (represents through tables) which is very easy to understand.</font></p>  <p><font size="2" face="Calibri">The other benefits of doing that are</font></p>  <p><font size="2" face="Calibri">· It enhances the ease of understanding</font></p>  <p><font size="2" face="Calibri">· You can run reports and determine how many alerts are there, how many errors are there, how many warnings are there etc…</font></p>  <p><font size="2" face="Calibri">· You can build your own custom applications on top of that data, prepare beautiful charts, reports and show them to your senior management</font></p>  <p><font size="2" face="Calibri">· We can prioritize our action plans like first we want to see how many warnings/errors/informational messages are there and based upon that we want to decide which to address first etc…</font></p>  <p><font size="2" face="Calibri">And the list goes on based upon your creativity…the whole point here is bringing that data into much usable format</font></p>  <p><font size="2" face="Calibri">A sample snippet from the XML file generated by the BPA looks like this</font></p>  <blockquote>   <p align="left"><font size="2" face="Courier New">&lt;Objs Version=&quot;1.1.0.1&quot; xmlns=&quot;https://schemas.microsoft.com/powershell/2004/04&quot;&gt;</font></p>    <p align="left"><font size="2" face="Courier New">&lt;Obj RefId=&quot;0&quot;&gt;</font></p>    <p align="left"><font size="2" face="Courier New">&lt;TN RefId=&quot;0&quot;&gt;</font></p>    <p align="left"><font size="2" face="Courier New">&lt;T&gt;Microsoft.BaselineConfigurationAnalyzer.CoreInterface.Model&lt;/T&gt;</font></p>    <p align="left"><font size="2" face="Courier New">&lt;T&gt;System.Object&lt;/T&gt;</font></p>    <p align="left"><font size="2" face="Courier New">&lt;/TN&gt;</font></p>    <p align="left"><font size="2" face="Courier New">&lt;ToString&gt;Microsoft.BaselineConfigurationAnalyzer.CoreInterface.Model&lt;/ToString&gt;</font></p>    <p align="left"><font size="2" face="Courier New">&lt;Props&gt;</font></p>    <p align="left"><font size="2" face="Courier New">&lt;S N=&quot;Id&quot;&gt;SQL2008R2BPA&lt;/S&gt;</font></p>    <p align="left"><font size="2" face="Courier New">&lt;S N=&quot;Company&quot;&gt;Microsoft&lt;/S&gt;</font></p>    <p align="left"><font size="2" face="Courier New">&lt;S N=&quot;Name&quot;&gt;SQL Server 2008 R2 BPA&lt;/S&gt;</font></p>    <p align="left"><font size="2" face="Courier New">&lt;Version N=&quot;Version&quot;&gt;1.0&lt;/Version&gt;</font></p>    <p align="left"><font size="2" face="Courier New">&lt;S N=&quot;LastScanTime&quot;&gt;10/03/2013 13:29:35&lt;/S&gt;</font></p>    <p align="left"><font size="2" face="Courier New">&lt;Obj N=&quot;SubModels&quot; RefId=&quot;1&quot;&gt;</font></p>    <p align="left"><font size="2" face="Courier New">&lt;TN RefId=&quot;1&quot;&gt;</font></p>    <p align="left"><font size="2" face="Courier New">&lt;T&gt;System.Collections.Generic.List`1[[System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]&lt;/T&gt;</font></p>    <p align="left"><font size="2" face="Courier New">&lt;T&gt;System.Object&lt;/T&gt;</font></p>    <p align="left"><font size="2" face="Courier New">&lt;/TN&gt;</font></p>    <p align="left"><font size="2" face="Courier New">&lt;LST&gt;</font></p>    <p align="left"><font size="2" face="Courier New">&lt;S&gt;AnalysisServices&lt;/S&gt;</font></p>    <p align="left"><font size="2" face="Courier New">&lt;S&gt;Engine&lt;/S&gt;</font></p>    <p align="left"><font size="2" face="Courier New">&lt;S&gt;IntegrationServices&lt;/S&gt;</font></p>    <p align="left"><font size="2" face="Courier New">&lt;S&gt;Replication&lt;/S&gt;</font></p>    <p align="left"><font size="2" face="Courier New">&lt;S&gt;ReportingServices&lt;/S&gt;</font></p>    <p align="left"><font size="2" face="Courier New">&lt;S&gt;Setup&lt;/S&gt;</font></p>    <p align="left"><font size="2" face="Courier New">&lt;/LST&gt;</font></p>    <p align="left"><font size="2" face="Courier New">.</font></p>    <p align="left"><font size="2" face="Courier New">.</font></p>    <p align="left"><font size="2" face="Courier New">.</font></p>    <p align="left"><font size="2" face="Courier New">.</font></p>    <p align="left"><font size="2" face="Courier New">&lt;Obj RefId=&quot;19&quot;&gt;</font></p>    <p align="left"><font size="2" face="Courier New">&lt;TN RefId=&quot;5&quot;&gt;</font></p>    <p align="left"><font size="2" face="Courier New">&lt;T&gt;System.Object[]&lt;/T&gt;</font></p>    <p align="left"><font size="2" face="Courier New">&lt;T&gt;System.Array&lt;/T&gt;</font></p>    <p align="left"><font size="2" face="Courier New">&lt;T&gt;System.Object&lt;/T&gt;</font></p>    <p align="left"><font size="2" face="Courier New">&lt;/TN&gt;</font></p>    <p align="left"><font size="2" face="Courier New">&lt;LST&gt;</font></p>    <p align="left"><font size="2" face="Courier New">&lt;Obj RefId=&quot;20&quot;&gt;</font></p>    <p align="left"><font size="2" face="Courier New">&lt;TN RefId=&quot;6&quot;&gt;</font></p>    <p align="left"><font size="2" face="Courier New">&lt;T&gt;Microsoft.BaselineConfigurationAnalyzer.CoreInterface.Result&lt;/T&gt;</font></p>    <p align="left"><font size="2" face="Courier New">&lt;T&gt;System.Object&lt;/T&gt;</font></p>    <p align="left"><font size="2" face="Courier New">&lt;/TN&gt;</font></p>    <p align="left"><font size="2" face="Courier New">&lt;ToString&gt;Microsoft.BaselineConfigurationAnalyzer.CoreInterface.Result&lt;/ToString&gt;</font></p>    <p align="left"><font size="2" face="Courier New">&lt;Props&gt;</font></p>    <p align="left"><font size="2" face="Courier New">&lt;S N=&quot;ResultNumber&quot;&gt;1&lt;/S&gt;</font></p>    <p align="left"><font size="2" face="Courier New">&lt;S N=&quot;ResultId&quot;&gt;4196529084&lt;/S&gt;</font></p>    <p align="left"><font size="2" face="Courier New">&lt;S N=&quot;ModelId&quot;&gt;SQL2008R2BPA&lt;/S&gt;</font></p>    <p align="left"><font size="2" face="Courier New">&lt;S N=&quot;SubModelId&quot;&gt;Engine&lt;/S&gt;</font></p>    <p align="left"><font size="2" face="Courier New">&lt;S N=&quot;RuleId&quot;&gt;0&lt;/S&gt;</font></p>    <p align="left"><font size="2" face="Courier New">&lt;S N=&quot;ComputerName&quot;&gt;localhost&lt;/S&gt;</font></p>    <p align="left"><font size="2" face="Courier New">&lt;S N=&quot;Context&quot;&gt;SQL2008R2BPA&lt;/S&gt;</font></p>    <p align="left"><font size="2" face="Courier New">&lt;S N=&quot;Source&quot;&gt;localhost&lt;/S&gt;</font></p>    <p align="left"><font size="2" face="Courier New">&lt;S N=&quot;Severity&quot;&gt;Warning&lt;/S&gt;</font></p>    <p align="left"><font size="2" face="Courier New">&lt;S N=&quot;NeutralSeverity&quot;&gt;Warning&lt;/S&gt;</font></p>    <p align="left"><font size="2" face="Courier New">&lt;S N=&quot;Category&quot;&gt;Security&lt;/S&gt;</font></p>    <p align="left"><font size="2" face="Courier New">&lt;S N=&quot;Title&quot;&gt;Engine - Authentication Mode&lt;/S&gt;</font></p>    <p align="left"><font size="2" face="Courier New">&lt;S N=&quot;Problem&quot;&gt;The authentication mode is not set to recommended value&lt;/S&gt;</font></p>    <p align="left"><font size="2" face="Courier New">&lt;S N=&quot;Impact&quot;&gt;Windows Authentication is the default authentication mode, and is much more secure than SQL Server Authentication. Windows Authentication uses Kerberos security protocol, provides password policy enforcement with regard to complexity validation for strong passwords, provides support for account lockout, and supports password expiration&lt;/S&gt;</font></p>    <p align="left"><font size="2" face="Courier New">&lt;S N=&quot;Resolution&quot;&gt;Configure Authentication mode to Windows mode when possible&lt;/S&gt;</font></p>    <p align="left"><font size="2" face="Courier New">&lt;Nil N=&quot;Compliance&quot; /&gt;</font></p>    <p align="left"><font size="2" face="Courier New">&lt;S N=&quot;Help&quot;&gt;https://go.microsoft.com/fwlink/?LinkId=184392&lt;/S&gt;</font></p>    <p align="left"><font size="2" face="Courier New">&lt;S N=&quot;Excluded&quot;&gt;False&lt;/S&gt;</font></p>    <p align="left"><font size="2" face="Courier New">&lt;/Props&gt;</font></p>    <p align="left"><font size="2" face="Courier New">&lt;/Obj&gt;</font></p>    <p align="left"><font size="2" face="Courier New">&lt;Obj RefId=&quot;21&quot;&gt;</font></p>    <p align="left"><font size="2" face="Courier New">&lt;TNRef RefId=&quot;6&quot; /&gt;</font></p>    <p align="left"><font size="2" face="Courier New">&lt;ToString&gt;Microsoft.BaselineConfigurationAnalyzer.CoreInterface.Result&lt;/ToString&gt;</font></p> </blockquote>  <p><font size="2" face="Calibri">Please find the exercise I performed to push this valuable XML data into a table in the SQL server database</font></p>  <p><font size="2" face="Calibri">1). Modified the first line i.e. the Objs element – Changed it to something like this (&lt;Objs xmlns:xsi=&quot;https://www.w3.org/2001/XMLSchema-instance&quot; xmlns:xsd=&quot;https://www.w3.org/2001/XMLSchema&quot;&gt;)</font></p>  <p><font size="2" face="Calibri">2). Deleted the unnecessary content from the XML file (Till Ref ID 19 from the top)</font></p>  <p><font size="2" face="Calibri">3). Replaced &quot;Nil&quot; with &quot;S&quot;. The resultant XML schema looks like this</font></p>  <blockquote>   <p><font size="2" face="Courier New">&lt;Objs&gt;</font></p>    <p><font size="2" face="Courier New">&lt;Obj&gt;</font></p>    <p><font size="2" face="Courier New">&lt;Props&gt;</font></p>    <p><font size="2" face="Courier New">&lt;S&gt; &lt;/S&gt;</font></p>    <p><font size="2" face="Courier New">&lt;/Props&gt;</font></p>    <p><font size="2" face="Courier New">&lt;/Obj&gt;</font></p>    <p><font size="2" face="Courier New">&lt;/Objs&gt;</font></p> </blockquote>  <p><font size="2" face="Calibri">- Only one Objs element</font></p>  <p><font size="2" face="Calibri">- Multiple Obj elements inside Objs element</font></p>  <p><font size="2" face="Calibri">- Only one Props element Inside Obj element</font></p>  <p><font size="2" face="Calibri">- Multiple S elements inside Props</font></p>  <p><font size="2" face="Calibri">4). Create the table to put the XML data </font></p>  <blockquote>   <p><font size="2" face="Courier New">CREATE TABLE EXPRTRESTRCT19TBL (XMLDATA XML, LOADDATETIME date)</font></p> </blockquote>  <p><font size="2" face="Calibri">5). Prepare the insert statement by replacing the content between quotes with your new XML content. </font></p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/64/09/metablogapi/0285.clip_image002_4340C3EB.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-64-09-metablogapi/0285.clip_5F00_image002_5F00_4340C3EB.png"><font size="2" face="Calibri"><img title="clip_image002" style="display: inline;" border="0" hspace="12" alt="clip_image002" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/64/09/metablogapi/5554.clip_image002_thumb_685E0E57.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-64-09-metablogapi/5554.clip_5F00_image002_5F00_thumb_5F00_685E0E57.png" width="165" height="244" /></font></a></p>  <div id="scid:F60BB8FA-6F02-4999-8F5E-9DD4E92C4DA7:fcf31aaf-cfc4-4079-8ada-8a1dc46b65ae" class="wlWriterEditableSmartContent" style="margin: 0px; padding: 0px; float: none; display: inline;"><div><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/64/09/metablogapi/5417.Insert_Code_5F21D316.SQL" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-64-09-metablogapi/5417.Insert_5F00_Code_5F00_5F21D316.SQL" target="_blank">Insert_Code.SQL</a></div></div>  <p><font size="2" face="Calibri">To see the complete insert statement please click on the Insert_Code.SQL</font></p>  <p><font size="2" face="Calibri">After insert the table TEST2_CMCK_CSSPRDDB03_EXPRTRESTRCT12 contains the formatted XML data</font></p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/64/09/metablogapi/5280.clip_image003_55E597D5.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-64-09-metablogapi/5280.clip_5F00_image003_5F00_55E597D5.png"><font size="2" face="Calibri"><img title="clip_image003" style="display: inline;" border="0" alt="clip_image003" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/64/09/metablogapi/5314.clip_image003_thumb_1B8A21F4.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-64-09-metablogapi/5314.clip_5F00_image003_5F00_thumb_5F00_1B8A21F4.png" width="244" height="83" /></font></a></p>  <p><font size="2" face="Calibri">6). Create a table temp_values using the statement below</font></p>  <blockquote>   <p><font size="2" face="Calibri"><font face="Courier New">&quot;create table temp_values (UID integer identity,ID Integer,value NVARCHAR(MAX))&quot;</font> </font></p> </blockquote>  <p><font size="2" face="Calibri">7). Run the stored proc to populate temp_values table</font></p>  <blockquote>   <p><font size="2" face="Courier New">declare @idoc int,</font></p>    <p><font size="2" face="Courier New">@xmldata xml</font></p>    <p><font size="2" face="Courier New">Select @xmlData = XMLDATA from dbo.EXPRTRESTRCT19TBL --MAKE SURE YOU CHANGE THE TABLE NAME TO THE ONE YOU CREATED IN STEP-4</font></p>    <p><font size="2" face="Courier New">EXEC sp_xml_preparedocument @idoc OUTPUT, @xmldata</font></p>    <p><font size="2" face="Courier New">insert into temp_values (id,value)</font></p>    <p><font size="2" face="Courier New">Select * from Openxml(@idoc,'Objs/Obj/Props/S',1)</font></p>    <p><font size="2" face="Courier New">With (</font></p>    <p><font size="2" face="Courier New">ID NVARCHAR(MAX) '../S',</font></p>    <p><font size="2" face="Courier New">Value NVARCHAR(MAX) 'text()'</font></p>    <p><font size="2" face="Courier New">)</font></p>    <p><font size="2" face="Courier New">EXEC sp_xml_removedocument @idoc</font></p> </blockquote>  <p><font size="2" face="Calibri">8). Create a final result table which stores all the formatted output i.e. the final output</font></p>  <blockquote>   <p><font size="2" face="Courier New">drop table final_result_exprtresrct19</font></p>    <p><font size="2" face="Courier New">create table final_result_exprtresrct19 (ResultNumber NVARCHAR(MAX),ResultId NVARCHAR(MAX),ModelId NVARCHAR(MAX),SubModelId NVARCHAR(MAX),RuleId NVARCHAR(MAX),ComputerName NVARCHAR(MAX),Context NVARCHAR(MAX),</font></p>    <p><font size="2" face="Courier New">Source NVARCHAR(MAX),Severity NVARCHAR(MAX),NeutralSeverity NVARCHAR(MAX),Category NVARCHAR(MAX),Title NVARCHAR(MAX),Problem NVARCHAR(MAX),Impact NVARCHAR(MAX),</font></p>    <p><font size="2" face="Courier New">Resolution NVARCHAR(MAX),Compliance NVARCHAR(MAX),Help NVARCHAR(MAX),Excluded NVARCHAR(MAX));</font></p> </blockquote>  <p><font size="2" face="Calibri">--MAKE SURE YOU CHANGE THE TABLE NAME TO THE ONE YOU CREATED IN STEP-4</font></p>  <p><font size="2" face="Calibri">9). Execute the stored proc which takes input from temp table and formats the data and push it into the final result table we created in step-8</font></p>  <blockquote>   <p><font size="2" face="Courier New">-- REPLACE THE Set @index = &lt;WITH THE VALUE YOU GET FROM SELECT COUNT(*) FROM TEMP_VALUES&gt;</font></p>    <p><font size="2" face="Courier New">Declare @counter int,</font></p>    <p><font size="2" face="Courier New">@index int</font></p>    <p><font size="2" face="Courier New">Set @counter = 1</font></p>    <p><font size="2" face="Courier New">Set @index = 1278</font></p>    <p><font size="2" face="Courier New">While @counter &lt;= @index</font></p>    <p><font size="2" face="Courier New">Begin</font></p>    <p><font size="2" face="Courier New">insert into final_result</font></p>    <p><font size="2" face="Courier New">select </font></p>    <p><font size="2" face="Courier New">max(case when UID=@counter then value else '0' end) as ResultNumber,</font></p>    <p><font size="2" face="Courier New">max(case when UID=@counter+1 then value else '0' end) as ResultId,</font></p>    <p><font size="2" face="Courier New">max(case when UID=@counter+2 then value else '0' end) as ModelId,</font></p>    <p><font size="2" face="Courier New">max(case when UID=@counter+3 then value else '0' end) as SubModelId,</font></p>    <p><font size="2" face="Courier New">max(case when UID=@counter+4 then value else '0' end) as RuleId,</font></p>    <p><font size="2" face="Courier New">max(case when UID=@counter+5 then value else '0' end) as ComputerName,</font></p>    <p><font size="2" face="Courier New">max(case when UID=@counter+6 then value else '0' end) as Context,</font></p>    <p><font size="2" face="Courier New">max(case when UID=@counter+7 then value else '0' end) as Source,</font></p>    <p><font size="2" face="Courier New">max(case when UID=@counter+8 then value else '0' end) as Severity,</font></p>    <p><font size="2" face="Courier New">max(case when UID=@counter+9 then value else '0' end) as NeutralSeverity,</font></p>    <p><font size="2" face="Courier New">max(case when UID=@counter+10 then value else '0' end) as Category,</font></p>    <p><font size="2" face="Courier New">max(case when UID=@counter+11 then value else '0' end) as Title,</font></p>    <p><font size="2" face="Courier New">max(case when UID=@counter+12 then value else '0' end) as Problem,</font></p>    <p><font size="2" face="Courier New">max(case when UID=@counter+13 then value else '0' end) as Impact,</font></p>    <p><font size="2" face="Courier New">max(case when UID=@counter+14 then value else '0' end) as Resolution,</font></p>    <p><font size="2" face="Courier New">max(case when UID=@counter+15 then value else '0' end) as Compliance,</font></p>    <p><font size="2" face="Courier New">max(case when UID=@counter+16 then value else '0' end) as Help,</font></p>    <p><font size="2" face="Courier New">max(case when UID=@counter+17 then value else '0' end) as Excluded</font></p>    <p><font size="2" face="Courier New">from temp_values</font></p>    <p><font size="2" face="Courier New">Set @counter = @counter + 18</font></p>    <p><font size="2" face="Courier New">End</font></p> </blockquote>  <p><font size="2" face="Calibri">-- We have to make sure that this count i.e. 18 is the number of 'S' elements under the 'props' element</font></p>  <p><font size="2" face="Calibri">9). after executing the above stored procedure we’ll have all the XML data formatted in a nice tabular format in the final results table</font></p>  <p><font size="2" face="Calibri">A simple select statement from the final results table looks like this</font></p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/64/09/metablogapi/3343.clip_image005_67E1B595.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-64-09-metablogapi/3343.clip_5F00_image005_5F00_67E1B595.jpg"><font size="2" face="Calibri"><img title="clip_image005" style="display: inline;" border="0" hspace="12" alt="clip_image005" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/64/09/metablogapi/1643.clip_image005_thumb_3EF6A08C.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-64-09-metablogapi/1643.clip_5F00_image005_5F00_thumb_5F00_3EF6A08C.jpg" width="244" height="49" /></font></a></p>  <p><font size="2" face="Calibri">For example if you want to concentrate first on all the warnings, you can issue a simple select statement like </font></p>  <p><font size="2" face="Calibri">SELECT * FROM FINAL_RESULT WHERE SEVERITY=’Warning’;</font></p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/64/09/metablogapi/3833.clip_image007_56ADD7F2.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-64-09-metablogapi/3833.clip_5F00_image007_5F00_56ADD7F2.jpg"><font size="2" face="Calibri"><img title="clip_image007" style="display: inline;" border="0" hspace="12" alt="clip_image007" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/64/09/metablogapi/1122.clip_image007_thumb_66D99FEB.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-64-09-metablogapi/1122.clip_5F00_image007_5F00_thumb_5F00_66D99FEB.jpg" width="244" height="41" /></font></a></p>  <p><font size="2" face="Calibri">So this way we can arrange the BPA data in a more meaningful way and run reports and queries on those tables to make more sense/use of it.</font></p>  <p><font size="2" face="Calibri"></font></p>  <p><font size="2" face="Calibri">As always feel free to provide your feedback/comments on the article.</font></p>  <p><font size="2" face="Calibri"></font></p>  <p><font size="2" face="Calibri">Thanks,</font></p>  <p><font size="2" face="Calibri">Chandra</font></p>  <p><font size="2" face="Calibri"></font></p>]]></content:encoded>
    </item>
    <item>
      <title>Restore Database from a UNC path – Why SSMS doesn’t show network drives/paths in the restore wizard</title>
      <link>https://docs.microsoft.com/archive/blogs/sql_scratchpad/restore-database-from-a-unc-path-why-ssms-doesnt-show-network-drivespaths-in-the-restore-wizard</link>
      <pubDate>Tue, 11 Mar 2014 10:20:23 GMT</pubDate>
      <dc:creator><![CDATA[Chandra550]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/sql_scratchpad/2014/03/11/restore-database-from-a-unc-path-why-ssms-doesnt-show-network-drivespaths-in-the-restore-wizard/</guid>
      <description><![CDATA[Lot of times we get into a situation where we need to restore databases from backup files (.BAK)...]]></description>
      <content:encoded><![CDATA[<p><font size="2" face="Calibri"></font></p>  <p><font size="2" face="Calibri">Lot of times we get into a situation where we need to restore databases from backup files (.BAK) stored in a UNC/network share.</font></p>  <p><font size="2" face="Calibri">There are two ways we can do this </font></p>  <ul>   <li><font size="2" face="Calibri"> By giving the path in the RESTORE DATABASE command like RESTORE DATABASE FROM DISK = </font><a href="file:///\\server_name\shared_drive\backup_file_name.bak"><font size="2" face="Calibri">\\server_name\shared_drive\backup_file_name.bak</font></a></li>    <li><font size="2" face="Calibri"> By giving the path of the file (</font><a href="file:///\\server_name\shared_drive\backup_file_name.bak"><font size="2" face="Calibri">\\server_name\shared_drive\backup_file_name.bak</font></a><font size="2" face="Calibri">) in the management studio restore wizard as shown below</font></li> </ul>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/64/09/metablogapi/5280.clip_image002_1205CD88.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-64-09-metablogapi/5280.clip_5F00_image002_5F00_1205CD88.jpg"><font size="2" face="Calibri"><img title="clip_image002" style="display: inline;" border="0" alt="clip_image002" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/64/09/metablogapi/6153.clip_image002_thumb_0B724DF8.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-64-09-metablogapi/6153.clip_5F00_image002_5F00_thumb_5F00_0B724DF8.jpg" width="244" height="213" /></font></a></p>  <p><font size="2" face="Calibri">One of the big questions asked by lot of people in forums is why we’re unable to explore/locate a UNC path/ a network drive in this wizard.</font></p>  <p><font size="2" face="Calibri">For e.g. I have 2 local drives C, D and a network drive in my PC and a network drive Z. please find the screen shot below to confirm that.</font></p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/64/09/metablogapi/1200.clip_image004_491F35B4.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-64-09-metablogapi/1200.clip_5F00_image004_5F00_491F35B4.jpg"><font size="2" face="Calibri"><img title="clip_image004" style="display: inline;" border="0" alt="clip_image004" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/64/09/metablogapi/0654.clip_image004_thumb_79D23D5F.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-64-09-metablogapi/0654.clip_5F00_image004_5F00_thumb_5F00_79D23D5F.jpg" width="244" height="37" /></font></a></p>  <p><font size="2" face="Calibri">But I see only C and D in SSMS (SQL Server management Studio) restore Wizard.</font></p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/64/09/metablogapi/0601.clip_image006_1FC7EDB6.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-64-09-metablogapi/0601.clip_5F00_image006_5F00_1FC7EDB6.jpg"><font size="2" face="Calibri"><img title="clip_image006" style="display: inline;" border="0" hspace="12" alt="clip_image006" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/64/09/metablogapi/2625.clip_image006_thumb_3DC5FBAA.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-64-09-metablogapi/2625.clip_5F00_image006_5F00_thumb_5F00_3DC5FBAA.jpg" width="244" height="212" /></font></a></p>  <p><font size="2" face="Calibri">Why is this happening? I tried to find the answer through <b>Profiler </b>(the tool that was made in heaven, by god J).</font></p>  <p><font size="2" face="Calibri">I was doing a restore through the restore wizard, reached the above shown screen which displays the directories and files in it. In the background I invoked profiler trace.</font></p>  <p><font size="2" face="Calibri">Please find the profiler trace output below</font></p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/64/09/metablogapi/2570.clip_image008_0E27DD1E.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-64-09-metablogapi/2570.clip_5F00_image008_5F00_0E27DD1E.jpg"><font size="2" face="Calibri"><img title="clip_image008" style="display: inline;" border="0" hspace="12" alt="clip_image008" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/64/09/metablogapi/5287.clip_image008_thumb_19DD2450.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-64-09-metablogapi/5287.clip_5F00_image008_5F00_thumb_5F00_19DD2450.jpg" width="244" height="190" /></font></a></p>  <p><font size="2" face="Calibri">One interesting thing I found is the procedure “<b>dbo.xp_fixeddrives</b>”. This procedure is called in the background when we invoke the restore wizard in GUI. And this procedure get all the available drives, free space available in each drive etc </font></p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/64/09/metablogapi/6201.clip_image009_70F20F46.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-64-09-metablogapi/6201.clip_5F00_image009_5F00_70F20F46.png"><font size="2" face="Calibri"><img title="clip_image009" style="display: inline;" border="0" hspace="12" alt="clip_image009" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/64/09/metablogapi/5460.clip_image009_thumb_36969965.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-64-09-metablogapi/5460.clip_5F00_image009_5F00_thumb_5F00_36969965.png" width="244" height="109" /></font></a><font size="2" face="Calibri">And if we run it in the query window directly, itgives the below output</font></p>  <p><font size="2" face="Calibri">If we observe the complete flow,</font></p>  <p><font size="2" face="Calibri">· First we’re calling xp_fixeddrives</font></p>  <p><font size="2" face="Calibri">· Getting the names of fixed drives. Here in my case C,D</font></p>  <p><font size="2" face="Calibri">· Passing them to another procedure called xp_dirtree, one at a time (This procedure takes an argument for e.g. logical drives like C, D and lists all the folders and files present in that drive in a loop)</font></p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/64/09/metablogapi/2804.clip_image011_1BE9FD4C.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-64-09-metablogapi/2804.clip_5F00_image011_5F00_1BE9FD4C.jpg"><font size="2" face="Calibri"><img title="clip_image011" style="display: inline;" border="0" hspace="12" alt="clip_image011" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/64/09/metablogapi/6567.clip_image011_thumb_2BA99250.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-64-09-metablogapi/6567.clip_5F00_image011_5F00_thumb_5F00_2BA99250.jpg" width="244" height="137" /></font></a><font size="2" face="Calibri">Below screenshot shows the flow of actions I mentioned above, step by step.</font></p>  <p><font size="2" face="Calibri">So this procedure xp_fixeddrives can see only the fixed drives on the local computer if we execute it without any parameters.</font></p>  <p><font size="2" face="Calibri">But if you notices there’s another statement like “xp_fixeddrives 1” which is executed too. This actually lists all the network drives that are mapped to this computer.</font></p>  <p><font size="2" face="Calibri">But when we execute it in SSMS we won’t see anything. This is because to list the network drives by this procedure the share must be mapped as a network drive in the session in which      <br />SQL Server is running. If you start sqlservr.exe from command line, SQL Server will see any drives you have mapped in your login session. When you run sqlservr.exe as a service, however,       <br />SQL Server runs in a separate session that has no relation to your login session. You need to map the       <br />drive in the session that SQL is running in.</font></p>  <p><font size="2" face="Calibri">So as a work around, to make network drives visible I did the following steps.</font></p>  <p><font size="2" face="Calibri">1). Created a directory in the remote computer</font></p>  <p><font size="2" face="Calibri">2). Shared it with “Everyone” – Actually We just need to make sure that the service account under which SQL is running is having permissions to access the shared folder).</font></p>  <p><font size="2" face="Calibri">3). Enabled XP_CMDSHELL by issuing</font></p>  <p><font size="2" face="Calibri">sp_configure 'XP_CMDSHELL' , 1 </font></p>  <p><font size="2" face="Calibri">reconfigure with override</font></p>  <p><font size="2" face="Calibri">4). Mapped the network drive in the same session as SQL is running by issuing</font></p>  <p><font size="2" face="Calibri">xp_Cmdshell ‘net use p: \\csm1\bkp_test’</font></p>  <p><font size="2" face="Calibri">5). Now executed xp_fixeddrives with argument 1</font></p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/64/09/metablogapi/7571.clip_image012_10FCF637.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-64-09-metablogapi/7571.clip_5F00_image012_5F00_10FCF637.png"><font size="2" face="Calibri"><img title="clip_image012" style="display: inline;" border="0" alt="clip_image012" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/64/09/metablogapi/4774.clip_image012_thumb_56A18055.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-64-09-metablogapi/4774.clip_5F00_image012_5F00_thumb_5F00_56A18055.png" width="244" height="126" /></font></a></p>  <p><font size="2" face="Calibri">6). The restore wizard now shows network drives </font></p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/64/09/metablogapi/1524.clip_image014_270361C9.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-64-09-metablogapi/1524.clip_5F00_image014_5F00_270361C9.jpg"><font size="2" face="Calibri"><img title="clip_image014" style="display: inline;" border="0" hspace="12" alt="clip_image014" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/64/09/metablogapi/0407.clip_image014_thumb_7E184CBF.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-64-09-metablogapi/0407.clip_5F00_image014_5F00_thumb_5F00_7E184CBF.jpg" width="170" height="244" /></font></a></p>  <p><font size="2" face="Calibri">So finally we’re able to see the network drives J</font></p>  <p><font size="2" face="Calibri">But one caveat here is this will go off once we restart the SQL server. So to prevent that we can create a stored procedure like below and make it as a “Startup Procedure” or procedure that runs on every startup.</font></p>  <p><font size="2" face="Calibri">CREATE PROCEDURE [dbo].[startupnetmap]</font></p>  <p><font size="2" face="Calibri">AS</font></p>  <p><font size="2" face="Calibri">exec xp_Cmdshell 'net use p: \\csm1\bkp_test'</font></p>  <p><font size="2" face="Calibri">go</font></p>  <p><font size="2" face="Calibri">And enable it to run at startup by giving</font></p>  <p><font size="2" face="Calibri">exec sp_procoption 'startupnetmap','startup','true'</font></p>  <p><font size="2" face="Calibri">So this is why SSMS doesn’t show network drives and this is how we can work around the issue.</font></p>  <p><font size="2" face="Calibri"></font></p>  <p><font size="2" face="Calibri">Feel free to share your comments and feedback on this.</font></p>  <p><font size="2" face="Calibri"></font></p>  <p><font size="2" face="Calibri">Regards,</font></p>  <p><font size="2" face="Calibri">Chandra</font></p>  <p><font size="2" face="Calibri"></font></p>]]></content:encoded>
    </item>
    <item>
      <title>SQL 2012 cluster installation fails with disk resource can’t be moved error</title>
      <link>https://docs.microsoft.com/archive/blogs/sql_scratchpad/sql-2012-cluster-installation-fails-with-disk-resource-cant-be-moved-error</link>
      <pubDate>Tue, 11 Mar 2014 09:48:21 GMT</pubDate>
      <dc:creator><![CDATA[Chandra550]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/sql_scratchpad/2014/03/11/sql-2012-cluster-installation-fails-with-disk-resource-cant-be-moved-error/</guid>
      <description><![CDATA[When I was working with one of the customers on SQL server 2012 failover cluster installation, we...]]></description>
      <content:encoded><![CDATA[<p><font size="2" face="Calibri">When I was working with one of the customers on SQL server 2012 failover cluster installation, we came across a problem because of which cluster installations fails by throwing the below error </font></p>  <p><font size="2" face="Calibri">“The resource 'disk p' could not be moved<b> </b>from cluster group 'Available Storage' to cluster group 'SQL Server (MSSQLSERVER)' “</font></p>  <p><font size="2" face="Calibri">By looking at the error message we can infer that it’s something related to the inability of the installer to move clustered disk resource to the group/role created by the SQL installer in this case SQL Server (MSSQLSERVER).</font></p>  <p><font size="2" face="Calibri">Some of the errors in your detail.txt looks like below</font></p>  <p><font size="2" face="Calibri">01) 2013-12-02 09:20:57 Slp:&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; The resource ‘Disk P’ could not be moved from cluster group 'Available Storage' to cluster group 'SQL Server (MSSQLSERVER)'. Error: There was a failure to call cluster code from a provider. Exception message: Generic failure . Status code: 183. Description: Cannot create a file when that file already exists.     <br />(01) 2013-12-02 09:20:57 Slp:&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; .      <br />(01) 2013-12-02 09:20:57 Slp:&#160;&#160;&#160;&#160; HResult : 0x86d80035      <br />(01) 2013-12-02 09:20:57 Slp:&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; FacilityCode : 1752 (6d8)      <br />(01) 2013-12-02 09:20:57 Slp:&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; ErrorCode : 53 (0035)      <br />(01) 2013-12-02 09:20:57 Slp:&#160;&#160;&#160;&#160; Data:       <br />(01) 2013-12-02 09:20:57 Slp:&#160;&#160;&#160;&#160; resourceName = Disk P      <br />(01) 2013-12-02 09:20:57 Slp:&#160;&#160;&#160;&#160; groupName1 = Available Storage      <br />(01) 2013-12-02 09:20:57 Slp:&#160;&#160;&#160;&#160; groupName2 = SQL Server (MSSQLSERVER)      <br />(01) 2013-12-02 09:20:57 Slp:&#160;&#160;&#160;&#160; errorMessage = There was a failure to call cluster code from a provider. Exception message: Generic failure. Status code: 183. Description: Cannot create a file when that file already exists.      <br />.(01) 2013-12-02 09:20:57 Slp: WatsonData = Microsoft.SqlServer.Configuration.Cluster.ChangeClusterGroupOperationException@53</font></p>  <p><font size="2" face="Calibri">(01) 2013-12-02 09:20:57 Slp: SQL.Setup.FailureCategory = ConfigurationFailure</font></p>  <p><font size="2" face="Calibri">(01) 2013-12-02 09:20:57 Slp: WatsonConfigActionData = INSTALL@CONFIGNONRC@SQL_ENGINE_CORE_INST</font></p>  <p><font size="2" face="Calibri">(01) 2013-12-02 09:20:57 Slp: WatsonExceptionFeatureIdsActionData = System.String[]</font></p>  <p><font size="2" face="Calibri">(01) 2013-12-02 09:20:57 Slp: Stack: </font></p>  <p><font size="2" face="Calibri">(01) 2013-12-02 09:20:57 Slp: at Microsoft.SqlServer.Configuration.Cluster.ClusterResource.ChangeResourceGroup(ClusterGroup g)</font></p>  <p><font size="2" face="Calibri">(01) 2013-12-02 09:20:57 Slp: at Microsoft.SqlServer.Configuration.ClusterConfiguration.ClusterDiskPrivateConfigObject.MoveClusterDisksToGroup(ClusterDiskPublicConfigObject diskConfig)</font></p>  <p><font size="2" face="Calibri">(01) 2013-12-02 09:20:57 Slp: at Microsoft.SqlServer.Configuration.ClusterConfiguration.ClusterDiskPrivateConfigObject.Install(ConfigActionTiming timing, Dictionary`2 actionData, PublicConfigurationBase spcb)</font></p>  <p><font size="2" face="Calibri">(01) 2013-12-02 09:20:57 Slp: at Microsoft.SqlServer.Configuration.SqlConfigBase.SlpConfigAction.ExecuteAction(String actionId)</font></p>  <p><font size="2" face="Calibri">(01) 2013-12-02 09:20:57 Slp: at Microsoft.SqlServer.Configuration.SqlConfigBase.SlpConfigAction.Execute(String actionId, TextWriter errorStream)</font></p>  <p><font size="2" face="Calibri">(01) 2013-12-02 09:20:57 Slp: Inner exception type: Microsoft.SqlServer.Configuration.Cluster.ClusterProviderDetailedException</font></p>  <p><font size="2" face="Calibri">(01) 2013-12-02 09:20:57 Slp: Message: </font></p>  <p><font size="2" face="Calibri">(01) 2013-12-02 09:20:57 Slp: There was a failure to call cluster code from a provider. Exception message: Generic failure . Status code: 183. Description: Cannot create a file when that file already exists.</font></p>  <p><font size="2" face="Calibri">(01) 2013-12-02 09:20:57 Slp: .</font></p>  <p><font size="2" face="Calibri">(01) 2013-12-02 09:20:57 Slp: HResult : 0x86d70002</font></p>  <p><font size="2" face="Calibri">(01) 2013-12-02 09:20:57 Slp: FacilityCode : 1751 (6d7)</font></p>  <p><font size="2" face="Calibri">(01) 2013-12-02 09:20:57 Slp: ErrorCode : 2 (0002)</font></p>  <p><font size="2" face="Calibri">(01) 2013-12-02 09:20:57 Slp: Data: </font></p>  <p><font size="2" face="Calibri">(01) 2013-12-02 09:20:57 Slp: ExceptionMessage = Generic failure </font></p>  <p><font size="2" face="Calibri">(01) 2013-12-02 09:20:57 Slp: StatusCode = 183</font></p>  <p><font size="2" face="Calibri">(01) 2013-12-02 09:20:57 Slp: Description = Cannot create a file when that file already exists.</font></p>  <p><font size="2" face="Calibri">(01) 2013-12-02 09:20:57 Slp: WatsonData = Microsoft.SqlServer.Configuration.Cluster.ClusterProviderDetailedException@2</font></p>  <p><font size="2" face="Calibri">(01) 2013-12-02 09:20:57 Slp: Stack: </font></p>  <p><font size="2" face="Calibri">(01) 2013-12-02 09:20:57 Slp: at Microsoft.SqlServer.Configuration.Cluster.WmiClusterResource.ChangeResourceGroup(String group)</font></p>  <p><font size="2" face="Calibri">(01) 2013-12-02 09:20:57 Slp: at Microsoft.SqlServer.Configuration.Cluster.ClusterResource.ChangeResourceGroup(ClusterGroup g)</font></p>  <p><font size="2" face="Calibri">(01) 2013-12-02 09:20:57 Slp: Inner exception type: System.Management.ManagementException</font></p>  <p><font size="2" face="Calibri">(01) 2013-12-02 09:20:57 Slp: Message: </font></p>  <p><font size="2" face="Calibri">(01) 2013-12-02 09:20:57 Slp: Generic failure</font></p>  <p><font size="2" face="Calibri">(01) 2013-12-02 09:20:57 Slp: HResult : 0x80131501</font></p>  <p><font size="2" face="Calibri">(01) 2013-12-02 09:20:57 Slp: Data: </font></p>  <p><font size="2" face="Calibri">(01) 2013-12-02 09:20:57 Slp: WmiErrorCode = Failed</font></p>  <p><font size="2" face="Calibri">(01) 2013-12-02 09:20:57 Slp: WatsonData = Failed@183</font></p>  <p><font size="2" face="Calibri">(01) 2013-12-02 09:20:57 Slp: Description = Cannot create a file when that file already exists.</font></p>  <p><font size="2" face="Calibri">(01) 2013-12-02 09:20:57 Slp: ErrorType = 1</font></p>  <p><font size="2" face="Calibri">(01) 2013-12-02 09:20:57 Slp: Operation = ExecMethod</font></p>  <p><font size="2" face="Calibri">(01) 2013-12-02 09:20:57 Slp: ParameterInfo = MSCluster_Resource.Name=&quot;Disk S&quot;</font></p>  <p><font size="2" face="Calibri">(01) 2013-12-02 09:20:57 Slp: ProviderName = WinMgmt</font></p>  <p><font size="2" face="Calibri">(01) 2013-12-02 09:20:57 Slp: StatusCode = 183</font></p>  <p><font size="2" face="Calibri">(01) 2013-12-02 09:20:57 Slp: Stack: </font></p>  <p><font size="2" face="Calibri">(01) 2013-12-02 09:20:57 Slp: at System.Management.ManagementException.ThrowWithExtendedInfo(ManagementStatus errorCode)</font></p>  <p><font size="2" face="Calibri">(01) 2013-12-02 09:20:57 Slp: at System.Management.ManagementObject.InvokeMethod(String methodName, ManagementBaseObject inParameters, InvokeMethodOptions options)</font></p>  <p><font size="2" face="Calibri">(01) 2013-12-02 09:20:57 Slp: at Microsoft.SqlServer.Configuration.WMIInterop.Resource.MoveToNewGroup(String Group)</font></p>  <p><font size="2" face="Calibri">(01) 2013-12-02 09:20:57 Slp: at Microsoft.SqlServer.Configuration.Cluster.WmiClusterResource.ChangeResourceGroup(String group)</font></p>  <p><font size="2" face="Calibri">(01) 2013-12-02 09:20:57 Slp: Watson Bucket 2 </font></p>  <p><font size="2" face="Calibri">Original Parameter Values</font></p>  <p><font size="2" face="Calibri">So we cancelled the installer and tried to move the disk resource (disk p) to the SQL role manually, through the failover cluster manager console. When I do a right click on the resource (disk) and click on the option move, the pop-up just goes away as if it has successfully moved the resource without throwing any errors but when I go and check in the resources tab, the disk which I tried to move still shows up under the ‘Available Storage’ instead of showing under the SQL resource group.</font></p>  <p><font size="2" face="Calibri">As I’m not a clustering expert, I didn’t do much research on this behaviour. But I observed this phenomenon when we use a disk resource that's having a LUN mounted as the base mount point and other LUNs mounted as folders inside it and dependencies setup among the mounted folders and the base mount point. The issue might be because of SQL installer tries to establish the dependencies at the install time, again, but as the dependencies are already there it fails to set them up (Again it’s based upon an assumption but not substantiated with any proofs). </font></p>  <p><font size="2" face="Calibri">So the workaround was,</font></p>  <p><font size="2" face="Calibri">1. End the setup</font></p>  <p><font size="2" face="Calibri">2. Go to the failover cluster manager</font></p>  <p><font size="2" face="Calibri">3. Create a role– Just click on the roles (left pane), and click “create empty role” on the right pane</font></p>  <p><font size="2" face="Calibri">4. A new role will be created with a name like “New Role”. Rename it to SQL Server (MSSQLSERVER) or whatever instance name you want</font></p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/64/09/metablogapi/3201.clip_image002_7C17119C.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-64-09-metablogapi/3201.clip_5F00_image002_5F00_7C17119C.jpg"><font size="2" face="Calibri"><img title="clip_image002" style="display: inline;" border="0" alt="clip_image002" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/64/09/metablogapi/1588.clip_image002_thumb_0BD6A6A1.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-64-09-metablogapi/1588.clip_5F00_image002_5F00_thumb_5F00_0BD6A6A1.jpg" width="244" height="157" /></font></a></p>  <p><font size="2" face="Calibri">5. Move the disks using the command Move-ClusterResource &quot;&lt;DISK NAME&gt;&quot; &quot;SQL Server (&lt;SQL INSTANCE NAME&gt;)&quot; – MAKE SURE YOU LAUNCH POWERSHELL AS ADMINISTRATOR</font></p>  <p><font size="2" face="Calibri">Ref: </font><a href="https://technet.microsoft.com/en-us/library/ee461049.aspx"><font size="2" face="Calibri">https://technet.microsoft.com/en-us/library/ee461049.aspx</font></a></p>  <p><font size="2" face="Calibri">6. Launch the setup for the failover cluster installation and in the cluster resource group section select the pre-created role in the step 3 and continue with the setup (refer to the screen shot below)</font></p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/64/09/metablogapi/3527.clip_image004_712A0A87.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-64-09-metablogapi/3527.clip_5F00_image004_5F00_712A0A87.jpg"><font size="2" face="Calibri"><img title="clip_image004" style="display: inline;" border="0" alt="clip_image004" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/64/09/metablogapi/8357.clip_image004_thumb_2ED6F244.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-64-09-metablogapi/8357.clip_5F00_image004_5F00_thumb_5F00_2ED6F244.jpg" width="244" height="180" /></font></a></p>  <p><font size="2" face="Calibri">As we already moved the resource to the new role installer will skip the disk movement action and setup will be completed successfully.</font></p>  <p><font size="2" face="Calibri">Another workaround using which i was able to move the installation forward is,</font></p>  <p><font size="2" face="Calibri">1.&#160;&#160;&#160;&#160; End the setup     <br />2.&#160;&#160;&#160;&#160; Go to Control Panel/Programs and uninstall the database engine ONLY. Leave any other SQL Server installed components intact      <br />3.&#160;&#160;&#160;&#160; Open the cluster Manager and remove the Virtual Server (You can find it under the resources section of the role created by SQL installer), but leave the rest of the SQL Server resource group intact      <br />4.&#160;&#160;&#160;&#160; Move the disks using the command Move-ClusterResource &quot;&lt;DISK NAME&gt;&quot; &quot;SQL Server (&lt;SQL INSTANCE NAME&gt;)&quot; – MAKE SURE YOU LAUNCH POWERSHELL AS ADMINISTRATOR      <br />5.&#160;&#160;&#160;&#160; Begin the SQL cluster install again, specifying only the database engine. The installer will find and use the resource group and rebuild the virtual server.</font></p>  <p><font size="2" face="Calibri">The issue is not occurring in every environment. But from what I noticed, it's occurring when we select disk resource that's having a LUN as the base mount point, point and other LUNs mounted as folders </font></p>  <p><font size="2" face="Calibri">As always, please feel free to pass your comments/feedback.</font></p>  <p><font size="2" face="Calibri">Thanks,</font></p>  <p><font size="2" face="Calibri">Chandra</font></p>  <p><font size="2" face="Calibri"></font></p>]]></content:encoded>
    </item>
  </channel>
</rss>