<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.technet.com/utility/FeedStylesheets/atom.xsl" media="screen"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-US"><title type="html">Vipul Shah's SQL Blogs</title><subtitle type="html">SQL Server Blogs</subtitle><id>http://blogs.technet.com/vipulshah/atom.xml</id><link rel="alternate" type="text/html" href="http://blogs.technet.com/vipulshah/default.aspx" /><link rel="self" type="application/atom+xml" href="http://blogs.technet.com/vipulshah/atom.xml" /><generator uri="http://communityserver.org" version="2.1.61025.2">Community Server</generator><updated>2007-05-04T12:15:00Z</updated><entry><title>Failover Cluster Testing Methods</title><link rel="alternate" type="text/html" href="http://blogs.technet.com/vipulshah/archive/2009/06/17/failover-cluster-testing-methods.aspx" /><id>http://blogs.technet.com/vipulshah/archive/2009/06/17/failover-cluster-testing-methods.aspx</id><published>2009-06-18T01:19:51Z</published><updated>2009-06-18T01:19:51Z</updated><content type="html">&lt;p&gt;&lt;a name="_Toc116657126"&gt;&lt;/a&gt;&lt;a name="_Toc116378043"&gt;&lt;/a&gt;&lt;a name="_Toc493491548"&gt;&lt;strong&gt;1.1 System Failover Testing&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;During system testing, we will gather as much information as possible about the potential outcomes of system failures. We will not test, however, many component failures in the system such as a motherboard going out, losing a processor or having a cooling fan going out. These represent outages that have been planned for and many will be protected through Cluster Server, other failures will be covered through the fault-tolerance of the systems themselves (such as redundant power supply modules and cooling fans). We will test certain events that can cause failover within the cluster. These tests are listed below along with an explanation of the procedure along with the expected result of each test.&lt;/p&gt;  &lt;p&gt;&lt;a name="_Toc116657127"&gt;&lt;/a&gt;&lt;a name="_Toc116378044"&gt;&lt;/a&gt;&lt;a name="_Toc493491549"&gt;1.1.1 Disk Failure&lt;/a&gt;&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;b&gt;Purpose&lt;/b&gt;: The purpose of testing a disk failure is to ensure that the RAID configuration will continue without interruption. We will also look at hot-spares and ensure that in the event of a disk failure the hot-spare will pickup for the failed drive.&lt;/p&gt;    &lt;p&gt;&lt;a name="_Toc116378045"&gt;&lt;/a&gt;&lt;a name="_Toc493491550"&gt;&lt;b&gt;Test Procedure&lt;/b&gt;&lt;/a&gt;: The procedure for this test is to pull out one of the hard drives in the SAN array while that drive is operational and is currently used by one of the nodes within cluster.&lt;/p&gt;    &lt;p&gt;&lt;b&gt;Expected Result&lt;/b&gt;: Uninterrupted service; Windows should not discover any problems at all; RAID management software should report loss of a drive and complete the procedure of substituting the hot spare and rebuilding the drive array. Disk performance might be significantly reduced during this time&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&lt;a name="_Toc116657128"&gt;1.1.2 Power Failure&lt;/a&gt;&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;b&gt;Purpose&lt;/b&gt;: This test will verify that in the event of a server losing power, the opposite node in the cluster will bring all resources in the cluster online and resume operations.&lt;/p&gt;    &lt;p&gt;&lt;b&gt;Test Procedure&lt;/b&gt;: The procedure for this test is to simply pull all power plugs from one node while that node is operational and is hosting groups within cluster.&lt;/p&gt;    &lt;p&gt;&lt;a name="_Toc116378046"&gt;&lt;/a&gt;&lt;a name="_Toc493491551"&gt;&lt;b&gt;Expected Result&lt;/b&gt;&lt;/a&gt;: Cluster group hosted by the “failed” node should automatically fail over to a passive node. Service interruption should be in the range of 0-2 minutes.&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&lt;a name="_Toc116657129"&gt;1.1.3 Network Adapters&lt;/a&gt;&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;b&gt;Purpose&lt;/b&gt;: Testing network adapters will serve dual purposes. We will test the functionality of the heartbeat and the ability for cluster heartbeat communications to be routed over the public network. We will also test the failover scenario in the case of both public network adapters (members of the network team) losing connections to the network.&lt;/p&gt;    &lt;p&gt;&lt;b&gt;Test Procedure&lt;/b&gt;: First we will test the heartbeat interconnect and ensure that cluster communications are carried through the public network without interrupting cluster communications by disconnecting the private network adapter. Secondly, we will test network adapters to ensure that when one out of the two network adapters are unplugged, the other network adapter will communicate with the network as usual. Then we will unplug the remaining network adapter, which at this time is carrying all network communication, including the heartbeat. After this series of tests is complete, we will bring the system back to a normal configuration and test the public network adapters by removing their connection to the network. However, in this last test we will leave the heartbeat interconnect in place.&lt;/p&gt;    &lt;p&gt;&lt;a name="_Toc116378047"&gt;&lt;/a&gt;&lt;a name="_Toc493491552"&gt;&lt;b&gt;Expected Result&lt;/b&gt;&lt;/a&gt;: For a disconnected private adapter, Windows is expected to switch internal cluster communications to a public adapter automatically. There should be no service interruption. For disconnecting one of the public network cards, network team driver is expected to switch to using another network card automatically. There should be no service interruption. For disconnecting all network adapters, cluster is expected to initiate the failover once it discovers that active node is unavailable. Service interruption should be in the range of 0-2 minutes.&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&lt;a name="_Toc116657130"&gt;1.1.4 Fiber Channel Components&lt;/a&gt;&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;b&gt;Purpose&lt;/b&gt;: These tests will provide a level of understanding and documentation on expectations with regards to the redundancy of the fiber channel components within the HBA cards, the servers, and the CLARiiON SAN. We will be looking for results of unplugging certain components, simulating power losses, and other failures that will affect the cluster.&lt;/p&gt;    &lt;p&gt;&lt;b&gt;Test Procedure&lt;/b&gt;: During this test, we will disconnect the redundant fiber connections.&lt;/p&gt;    &lt;p&gt;&lt;a name="_Toc116378048"&gt;&lt;/a&gt;&lt;a name="_Toc493491553"&gt;&lt;b&gt;Expected Result&lt;/b&gt;&lt;/a&gt;: Depending on which fiber connection was disconnected, system should automatically switch to the reserved path. There should be no service interruption. In case of both fiber cables disconnected, so that cluster node completely loses communication to the SAN storage, cluster failover should be initiated. Service interruption should be in the range of 0-2 minutes.&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&lt;a name="_Toc116657131"&gt;&lt;strong&gt;1.2 Windows 2003 and SQL Server Failover Testing&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Microsoft Cluster Server will ensure that application services continue running within the cluster in the event that either there are failures in Windows 2003 that prevent the application from operating properly, or if SQL Server itself ceases to function properly. The cluster can detect these failures and fail the application over to a passive node. During these tests, it is important to note that our single point of failure within Windows 2003 and SQL Server is the database(s). If database itself becomes corrupt or experiences some other catastrophic failure, the only solution is to restore this database from a backup copy.&lt;/p&gt;  &lt;p&gt;Expected result in all tests is for a cluster to initiate the failover. Service interruption should be in the range of 0-2 minutes.&lt;/p&gt;  &lt;p&gt;&lt;a name="_Toc116657132"&gt;&lt;/a&gt;&lt;a name="_Toc116378049"&gt;&lt;/a&gt;&lt;a name="_Toc493491554"&gt;1.2.1 SQL Server Services&lt;/a&gt;&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;b&gt;Purpose&lt;/b&gt;: The purpose of simulating service failures is to ensure that failover will occur and to monitor the activity that occurs during failover. We will be looking for the time required for failover, proper failover and ensuring dependencies are being brought online properly.&lt;/p&gt;    &lt;p&gt;&lt;b&gt;Procedure&lt;/b&gt;: The best approach to testing a clustered service is to stop this service from the Services snap-in within the Management MMC. A service that has become a clustered resource can only be managed through the cluster administrator. Performing services operations through the Services snap-in will appear to the cluster as a failure and therefore will simulate a service failing. Following are the services we will attempt to fail.&lt;/p&gt;    &lt;ul&gt;     &lt;li&gt;SQL Server service &lt;/li&gt;      &lt;li&gt;SQL Server Agent service &lt;/li&gt;      &lt;li&gt;MS DTC service &lt;/li&gt;   &lt;/ul&gt; &lt;/blockquote&gt;  &lt;p&gt;&lt;a name="_Toc116657133"&gt;&lt;/a&gt;&lt;a name="_Toc116378050"&gt;&lt;/a&gt;&lt;a name="_Toc493491555"&gt;1.2.2 Windows 2003 Failure&lt;/a&gt;&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;b&gt;Purpose&lt;/b&gt;: The purpose here is to simulate the failure of Windows 2003 to demonstrate the ability of Cluster Server to realize Windows 2003 is not functioning/running on one of the clustered nodes and to initiate failover.&lt;/p&gt;    &lt;p&gt;&lt;b&gt;Procedure&lt;/b&gt;: Testing Windows 2003 failure will be difficult to simulate by any other means than simply choosing &lt;b&gt;Shut Down&lt;/b&gt;. This will stop all services on the node being shut down and this node will cease participation in the cluster. The cluster service will be notified on the opposite node and failover of the application will occur.&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&lt;a name="_Toc116657134"&gt;&lt;/a&gt;&lt;a name="_Toc116378051"&gt;&lt;/a&gt;&lt;a name="_Toc493491556"&gt;1.2.3 Cluster Service Failure&lt;/a&gt;&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;b&gt;Purpose&lt;/b&gt;: Cluster Service is responsible for maintaining cluster membership, monitoring resources and managing the clustered node. If this service were to fail, all clustered groups of resources would be forced to move to another cluster node. We will simulate a Cluster Service failure in this test and monitor the failover activity. &lt;/p&gt;    &lt;p&gt;&lt;b&gt;Procedure&lt;/b&gt;: Stop the Cluster Service from the Services snap-in and record results. &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&lt;a name="_Toc116657135"&gt;&lt;/a&gt;&lt;a name="_Toc116378052"&gt;&lt;/a&gt;&lt;a name="_Toc493491557"&gt;1.2.4 Quorum Failure&lt;/a&gt;&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;b&gt;Purpose&lt;/b&gt;: The Quorum serves as a log for changes that occur while one node of a cluster is offline and as a tiebreaker, in the event all heartbeat communications are lost. This test will observe the cluster behavior when the quorum is lost. To view the results of the quorum serving as a tiebreaker, view the results under “System Failover Testing” above.&lt;/p&gt;    &lt;p&gt;&lt;b&gt;Procedure&lt;/b&gt;: Utilize the SAN configuration utility and unpresent the quorum drive from the active node. This will provide us with the results that would be seen if the active node loses access to the quorum drive. Failover should be initiated. &lt;/p&gt;    &lt;p&gt;Utilize the RAID configuration utility and mark the logical drive of the quorum as offline. This will provide us with the results that would be seen if the drive that contains the quorum were to fail.&lt;/p&gt;&lt;/blockquote&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3256025" width="1" height="1"&gt;</content><author><name>vishah</name><uri>http://blogs.technet.com/members/vishah.aspx</uri></author></entry><entry><title>Extracting Project Actuals information from Microsoft Project Server (MSPS)</title><link rel="alternate" type="text/html" href="http://blogs.technet.com/vipulshah/archive/2009/05/06/extracting-project-actuals-information-from-microsoft-project-server-msps.aspx" /><id>http://blogs.technet.com/vipulshah/archive/2009/05/06/extracting-project-actuals-information-from-microsoft-project-server-msps.aspx</id><published>2009-05-06T18:52:10Z</published><updated>2009-05-06T18:52:10Z</updated><content type="html">&lt;p&gt;MSPS has four databases that it stores data from Enterprise Project Server – Draft, Published, Reporting, and Archive databases.&amp;#160;&amp;#160; It is recommended not to query Draft and Published databases directly.&amp;#160;&amp;#160; Reporting database as name indicates is the right database to query directly to extract MSPS data for further reporting of consumption in other applications.&amp;#160;&amp;#160;&amp;#160; I had a requirements to extract Project Actuals data and push it to one of custom app.&amp;#160;&amp;#160; Following are the views that I touched to extract data from -&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;MSP_EpmProject_UserView – Project Information View (High level Project definition data)&lt;/li&gt;    &lt;li&gt;MSP_EpmTask_UserView – Task Information View&lt;/li&gt;    &lt;li&gt;MSP_EpmResource_UserView – Resource Information View – All the Resource related information (name, windows NT account, CostCenter, etc.)&lt;/li&gt;    &lt;li&gt;MSP_EpmAssignment – Assignment Information Table&lt;/li&gt;    &lt;li&gt;MSP_EpmAssignmentByDay – Assignment Information Table&amp;#160; -- this is to extract Assignment Actual Work (TimeinHours) and Assignment Actual Cost (Invoiced Cost or any similar non-Labor cost)&lt;/li&gt; &lt;/ol&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3236346" width="1" height="1"&gt;</content><author><name>vishah</name><uri>http://blogs.technet.com/members/vishah.aspx</uri></author></entry><entry><title>Storage Consideration for SQL Server 2005 DW environment</title><link rel="alternate" type="text/html" href="http://blogs.technet.com/vipulshah/archive/2008/04/21/storage-consideration-for-sql-server-2005-dw-environment.aspx" /><id>http://blogs.technet.com/vipulshah/archive/2008/04/21/storage-consideration-for-sql-server-2005-dw-environment.aspx</id><published>2008-04-21T22:10:56Z</published><updated>2008-04-21T22:10:56Z</updated><content type="html">&lt;p&gt;Storage design is a key component of data warehouse/BI environment. Optimum storage design provides significant performance. SQL Server performance depends heavily on the I/O subsystem. Unless your database fits into physical memory, SQL Server constantly brings database pages in and out of the buffer pool. This generates substantial I/O traffic. Similarly, the log records need to be flushed to the disk before a transaction can be declared committed. And finally, SQL Server uses tempdb for various purposes such as to store intermediate results, to sort, to keep row versions and so on. So a good I/O subsystem is critical to the performance of SQL Server.&lt;/p&gt;  &lt;p&gt;Following key points should be considered while designing storage system for consolidated SQL Server environment.&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;RAID 1/0 (or RAID 10) gives excellent random read/write performance. RAID 10 is ideal for OLTP environment with lots of small random read/writes. This RAID type also provides good fault tolerance since it can survive the failure of up to half of the disks, provided one disk in each mirror image pair survives. Use RAID 10 if more than 30 percent of the IO is small random writes and if budget permits. RAID 10 is recommended for OLTP Data, Transaction Log, and Tempdb data volumes. &lt;/li&gt;    &lt;li&gt;RAID 5 gives excellent read performance, especially large sequential I/O. But it provides lower random write performance. It also delivers flower fault tolerance than RAID 10 since it can tolerate only one drive failure per RAID 5 LUN. Also, in the event of a drive failure, the time for the storage system to rebuild the content of the failed drive is longer than RAID 10. RAID 5 costs less for the same storage capacity compared to RAID 10. RAID 5 is ideal for Backup volumes. &lt;/li&gt;    &lt;li&gt;SQL Server log files are accessed sequentially and are write intensive. Since RAID 5 requires 4 I/O per write (write data, validate data, write parity, and validate parity), placing the log files on RAID 5 array greatly increases the possibility for an I/O bottleneck. Placing the data file and log files on the same drive spindles creates contention for the drive heads between the sequential movement required for the log writes versus the random drive head movement required to read and write data. Because of this, the log file should not be placed on the same set of spindles as the data files. The log files should be placed on a RAID 1+0 arrays. &lt;/li&gt;    &lt;li&gt;SQL Server 2005 makes greater use of tempdb than SQL Server 2000. For high performance applications, tempdb should be placed on a dedicated RAID 1+0 array and sized large enough so it does not auto grow. TempDB has a large number of objects being created all the time. For an object to be created, space must be allocated to it. Space allocation is determined by looking at some of the internal system pages (the GAM, and SGAM). In the end, it is these pages that start to have significant contention (with just one file) in a VERY active TempDB. To minimize that contention you should create multiple files. The guideline is to create as many numbers of files as the number of processor cores on the system. So, for example if you have dual core 8 way processor, you should have 16 files for your tempdb database. &lt;/li&gt;    &lt;li&gt;Backups should be made to drives other than the ones used for data and log not only to separate out I/Os, but physically separate drives means that even if the data or log disks fail, the backup drive will most likely still exist. Writing the backup file to the same set of disks means that the data file is being read from and the backup file is written to all using the same I/O pool. It also puts available space at risk since backups can fill up drives quickly without a proper retention policy to manage them. &lt;/li&gt;    &lt;li&gt;All versions of SQL Server write in 8k pages and the read ahead is 64k. The recommendation is to format any disks which may be used for SQL Server data using a 64k block size. Using defaults for NTFS (which is not 64K) will hamper SQL Server performance. Even if there is the potential that a disk may be used for SQL Server data, format it with a 64k block size. &lt;/li&gt;    &lt;li&gt;SQL Server on non-optimized and shared SAN where many different applications and I/O profiles access the same spindles can result in performance issues. Sections of the storage should be reserved for high performance SQL Server requirements and carved up at the time of deployment of the particular SQL Server solution. These storage allocations should not come from the general storage pool. &lt;/li&gt;    &lt;li&gt;Sector alignment. Sector alignment can increase the I/O performance of SQL Server by up to 20%. If sector alignment is required, this will be done via the command line utility DISKPART in Windows Server 2003 prior to formatting the disks with NTFS. &lt;/li&gt; &lt;/ul&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3041969" width="1" height="1"&gt;</content><author><name>vishah</name><uri>http://blogs.technet.com/members/vishah.aspx</uri></author></entry><entry><title>Data Protection Manager - an ultimate solution for protecting SQL Server data</title><link rel="alternate" type="text/html" href="http://blogs.technet.com/vipulshah/archive/2008/02/27/data-protection-manager-an-ultimate-solution-for-protecting-sql-server-data.aspx" /><id>http://blogs.technet.com/vipulshah/archive/2008/02/27/data-protection-manager-an-ultimate-solution-for-protecting-sql-server-data.aspx</id><published>2008-02-28T07:17:00Z</published><updated>2008-02-28T07:17:00Z</updated><content type="html">&lt;p&gt;I learned about new tool from Microsoft System Center family called Data Protection Manager 2007.&amp;#160;&amp;#160; Here is some details on how it works and how can it save big bucks when comparing with other backup compression tool in market such as LiteSpeed.&lt;/p&gt;  &lt;p&gt;Below is its overall architecture: &lt;/p&gt;  &lt;p&gt;&lt;span lang="EN-AU" style="font-size: 9.5pt; color: black; line-height: 110%; font-family: " yes?="yes?" mso-no-proof:="mso-no-proof:" AR-SA;="AR-SA;" mso-bidi-language:="mso-bidi-language:" JA;="JA;" mso-fareast-language:="mso-fareast-language:" EN-AU;="EN-AU;" mso-ansi-language:="mso-ansi-language:" Segoe;="Segoe;" mso-bidi-font-family:="mso-bidi-font-family:" Arial;="Arial;" mso-fareast-font-family:="mso-fareast-font-family:" segoe?,?sans-serif?;="segoe?,?sans-serif?;"&gt;&lt;shapetype id="_x0000_t75" stroked="f" filled="f" path="m@4@5l@4@11@9@11@9@5xe" o:preferrelative="t" o:spt="75" coordsize="21600,21600"&gt;&lt;a href="http://blogs.technet.com/blogfiles/vipulshah/WindowsLiveWriter/DataProtectionManageranultimatesolutionf_134C1/DPM%20Architecture_2.jpg"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="265" alt="DPM Architecture" src="http://blogs.technet.com/blogfiles/vipulshah/WindowsLiveWriter/DataProtectionManageranultimatesolutionf_134C1/DPM%20Architecture_thumb.jpg" width="485" align="left" border="0" /&gt;&lt;/a&gt;&amp;#160; &lt;stroke joinstyle="miter"&gt;&lt;/stroke&gt;&lt;formulas&gt;&lt;f eqn="if lineDrawn pixelLineWidth 0"&gt;&lt;/f&gt;&lt;f eqn="sum @0 1 0"&gt;&lt;/f&gt;&lt;f eqn="sum 0 0 @1"&gt;&lt;/f&gt;&lt;f eqn="prod @2 1 2"&gt;&lt;/f&gt;&lt;f eqn="prod @3 21600 pixelWidth"&gt;&lt;/f&gt;&lt;f eqn="prod @3 21600 pixelHeight"&gt;&lt;/f&gt;&lt;f eqn="sum @0 0 1"&gt;&lt;/f&gt;&lt;f eqn="prod @6 1 2"&gt;&lt;/f&gt;&lt;f eqn="prod @7 21600 pixelWidth"&gt;&lt;/f&gt;&lt;f eqn="sum @8 21600 0"&gt;&lt;/f&gt;&lt;f eqn="prod @7 21600 pixelHeight"&gt;&lt;/f&gt;&lt;f eqn="sum @10 21600 0"&gt;&lt;/f&gt;&lt;/formulas&gt;&lt;path o:connecttype="rect" gradientshapeok="t" o:extrusionok="f"&gt;&lt;/path&gt;&lt;lock aspectratio="t" v:ext="edit"&gt;&lt;/lock&gt;&lt;/shapetype&gt;&lt;shape id="Picture_x0020_1" style="visibility: visible; width: 414.75pt; height: 212.25pt" alt="DPM 2007-05 graphic B" type="#_x0000_t75" o:spid="_x0000_i1025"&gt;&lt;imagedata o:title="DPM 2007-05 graphic B" src="file:///C:\Users\vishah\AppData\Local\Temp\msohtmlclip1\01\clip_image001.png"&gt;&lt;/imagedata&gt;&lt;/shape&gt;&lt;/span&gt;&lt;span lang="EN-AU" style="font-size: 9.5pt; color: black; line-height: 110%; font-family: " yes?="yes?" mso-no-proof:="mso-no-proof:" AR-SA;="AR-SA;" mso-bidi-language:="mso-bidi-language:" JA;="JA;" mso-fareast-language:="mso-fareast-language:" EN-AU;="EN-AU;" mso-ansi-language:="mso-ansi-language:" Segoe;="Segoe;" mso-bidi-font-family:="mso-bidi-font-family:" Arial;="Arial;" mso-fareast-font-family:="mso-fareast-font-family:" segoe?,?sans-serif?;="segoe?,?sans-serif?;"&gt;&lt;shapetype id="_x0000_t75" stroked="f" filled="f" path="m@4@5l@4@11@9@11@9@5xe" o:preferrelative="t" o:spt="75" coordsize="21600,21600"&gt;&lt;/shapetype&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;How does SQL Server protection with DPM 2007 work?&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;DPM 2007 uses a combination of transaction log replication and block-level synchronization in conjunction with the SQL VSS Writer to help ensure your ability to recover SQL Server databases. After the initial baseline copy of data, two parallel processes enable continuous data protection with integrity:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Transaction logs are continuously synchronized to the DPM 2007 server, as often as every 15 minutes.&lt;/li&gt;    &lt;li&gt;An &amp;#8220;express full&amp;#8221; uses the SQL Server VSS Writer to identify which blocks have changed in the entire production database, and send just the updated blocks or fragments. This provides a complete and consistent image of the data files on the DPM server or appliance. DPM 2007 maintains up to 512 shadow copies of the full SQL Server database(s) by storing only the differences between any two images. &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Assuming one &amp;#8220;express full&amp;#8221; per week, stored as one of 512 shadow copy differentials between one week and the next, plus 7 days x 24 hours x 4 (every fifteen minutes), DPM 2007 can provide over 344,000 data consistent recovery points for SQL.&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;How does Restore work?&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;With only a few mouse clicks and DPM 2007, you can: &lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Restore a SQL database directly back to the original server&lt;/li&gt;    &lt;ul&gt;     &lt;li&gt;Databases are recovered back where they came from into the active SQL Server, with no additional work for the SQL administrator to do afterwards. This improves recovery time and reduces the number of people needed during a crisis recovery.&lt;/li&gt;   &lt;/ul&gt;    &lt;li&gt;Restore to a &amp;#8220;recovery database&amp;#8221; on the original server&lt;/li&gt;    &lt;ul&gt;     &lt;li&gt;This provides an alternative where the active SQL database is untouched, but the older data can be restored onto the same SQL server but in an alternate database &amp;#8211; allowing both versions of the data to be accessed independently but concurrently.&lt;/li&gt;   &lt;/ul&gt;    &lt;li&gt;Copy database files to an alternate server, &lt;/li&gt;    &lt;ul&gt;     &lt;li&gt;This option enables disaster recovery, compliance auditing, or software testing &amp;#8211; without affecting the production environment&lt;/li&gt;   &lt;/ul&gt;    &lt;li&gt;Copy the database file to tape,&lt;/li&gt;    &lt;ul&gt;     &lt;li&gt;Use this option to create a long-term archive or portable media of the data at any recovery point, even after the fact. For example, if the accounting department closes the quarterly books at 10:45 AM on a Tuesday, you can &amp;#8220;recover&amp;#8221; the data from that point, directly to tape &amp;#8211; without backing up anything else or impacting the production server that is already serving new data.&lt;/li&gt;   &lt;/ul&gt; &lt;/ul&gt;  &lt;p&gt;&lt;b&gt;Comparison of DPM 2007 with other Compressed Backup Utility:&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;Customer Scenario &amp;#8211; Protect 4 Databases totalling 250 GB for 14 days:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;With good compression efficiency of 70%, like LiteSpeed: &lt;/li&gt;    &lt;li&gt;30% additional disk space required on a production server&amp;#8217;s local disk, for nightly compressed backups &amp;#8211; which are then copied to the backup server at 75GB per night. &lt;/li&gt;    &lt;li&gt;Total additional disk to protect 250 GB for 14 days with LiteSpeed = 1.12 TB (75 GB on local production server plust 1.05 TB for 2 weeks, 75 GB each day) &lt;/li&gt;    &lt;li&gt;With DPM2007, you don&amp;#8217;t need additional local disk space. &lt;/li&gt;    &lt;li&gt;On DPM server, DPM replica &amp;#8220;Express Full&amp;#8221; which is exact replica of databases will consume 250 GB. In addition to that with DPM daily transaction logs at 10% change rate, it will require 25 GB on daily basis. So, to keep two weeks (14 days) of data on DPM server you need 575 GB (250 + (25 * 13)) as compared to 1.12 TB for LiteSpeed. &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;a href="http://blogs.technet.com/blogfiles/vipulshah/WindowsLiveWriter/DataProtectionManageranultimatesolutionf_134C1/DPM%20-%20comparison1_2.jpg"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="345" alt="DPM - comparison1" src="http://blogs.technet.com/blogfiles/vipulshah/WindowsLiveWriter/DataProtectionManageranultimatesolutionf_134C1/DPM%20-%20comparison1_thumb.jpg" width="511" align="left" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;b&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/b&gt;&lt;/p&gt;    &lt;p&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;    &lt;p&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;    &lt;p&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;    &lt;p&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;    &lt;p&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;    &lt;p&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;    &lt;p&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;    &lt;p&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;    &lt;p&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;    &lt;p&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;    &lt;p&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;    &lt;p&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;    &lt;p&gt;&lt;b&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;a href="http://blogs.technet.com/blogfiles/vipulshah/WindowsLiveWriter/DataProtectionManageranultimatesolutionf_134C1/DPM%20-%20comparison2_2.jpg"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="317" alt="DPM - comparison2" src="http://blogs.technet.com/blogfiles/vipulshah/WindowsLiveWriter/DataProtectionManageranultimatesolutionf_134C1/DPM%20-%20comparison2_thumb.jpg" width="489" border="0" /&gt;&lt;/a&gt; &lt;/b&gt;&lt;/p&gt;    &lt;p&gt;&lt;b&gt;&lt;a href="http://blogs.technet.com/blogfiles/vipulshah/WindowsLiveWriter/DataProtectionManageranultimatesolutionf_134C1/DPM%20-%20comparison3_2.jpg"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="367" alt="DPM - comparison3" src="http://blogs.technet.com/blogfiles/vipulshah/WindowsLiveWriter/DataProtectionManageranultimatesolutionf_134C1/DPM%20-%20comparison3_thumb.jpg" width="536" border="0" /&gt;&lt;/a&gt;&lt;/b&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=2938568" width="1" height="1"&gt;</content><author><name>vishah</name><uri>http://blogs.technet.com/members/vishah.aspx</uri></author></entry><entry><title>A Great SQL Resource - SQLCommunity.com</title><link rel="alternate" type="text/html" href="http://blogs.technet.com/vipulshah/archive/2008/02/07/a-great-sql-resource-sqlcommunity-com.aspx" /><id>http://blogs.technet.com/vipulshah/archive/2008/02/07/a-great-sql-resource-sqlcommunity-com.aspx</id><published>2008-02-08T08:13:00Z</published><updated>2008-02-08T08:13:00Z</updated><content type="html">&lt;P&gt;I came across &lt;A href="http://www.sqlcommunity.com/"&gt;www.SQLCommunity.com&lt;/A&gt; - a great resource for SQL Server.&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;
&lt;P&gt;It has tones of information including Scripts and Tools, Tips, Tricks and Techniques, lots of info on SQL Events, etc.&amp;nbsp; This site is run by Saleem Hakani - a Microsoft Database Engineer.&amp;nbsp; I know Saleem very well, he is very passionate about bringing SQL awareness world wide.&amp;nbsp;&amp;nbsp; He organizes many internal SQL events such as SQLFest, SQLSummit.&amp;nbsp;&amp;nbsp; I have attended one his event, and I must say,&amp;nbsp;in just one day I got&amp;nbsp;lot out of that event.&amp;nbsp;&amp;nbsp; I highly recommend to put his site in your SQL tool box.&amp;nbsp;&amp;nbsp; It could be your one stop shop for all you need from SQL Server.&lt;/P&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=2848684" width="1" height="1"&gt;</content><author><name>vishah</name><uri>http://blogs.technet.com/members/vishah.aspx</uri></author></entry><entry><title>Finding Missing Indexes and Unused Indexes using DMVs</title><link rel="alternate" type="text/html" href="http://blogs.technet.com/vipulshah/archive/2007/12/04/finding-missing-indexes-and-unused-indexes-using-dmvs.aspx" /><id>http://blogs.technet.com/vipulshah/archive/2007/12/04/finding-missing-indexes-and-unused-indexes-using-dmvs.aspx</id><published>2007-12-05T00:25:00Z</published><updated>2007-12-05T00:25:00Z</updated><content type="html">&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;Finding Missing Indexes:&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;TABLE class=MsoNormalTable style="BACKGROUND: #cccccc; MARGIN: auto auto auto -3.75pt; WIDTH: 101.6%; mso-cellspacing: 0in; mso-yfti-tbllook: 1184; mso-padding-alt: 0in 0in 0in 0in" cellSpacing=0 cellPadding=0 width="101%" border=1 class="MsoNormalTable"&gt;
&lt;TBODY&gt;
&lt;TR style="mso-yfti-irow: 0; mso-yfti-firstrow: yes"&gt;
&lt;TD class="" style="BORDER-RIGHT: #f0f0f0; PADDING-RIGHT: 0in; BORDER-TOP: #f0f0f0; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: #f0f0f0; PADDING-TOP: 0in; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: transparent"&gt;
&lt;P class=MsoNormal style="MARGIN: 6pt 0in 3pt 11.35pt"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;&lt;SPAN style="mso-ansi-language: EN-US; mso-fareast-language: EN-US"&gt;Dynamic management object &lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/B&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" style="BORDER-RIGHT: #f0f0f0; PADDING-RIGHT: 0in; BORDER-TOP: #f0f0f0; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: #f0f0f0; PADDING-TOP: 0in; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: transparent"&gt;
&lt;P class=MsoNormal style="MARGIN: 6pt 0in 3pt 11.35pt"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;&lt;SPAN style="mso-ansi-language: EN-US; mso-fareast-language: EN-US"&gt;Information returned &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/B&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR style="mso-yfti-irow: 1"&gt;
&lt;TD class="" style="BORDER-RIGHT: #f0f0f0; PADDING-RIGHT: 0in; BORDER-TOP: #f0f0f0; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: #f0f0f0; PADDING-TOP: 0in; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: transparent"&gt;
&lt;P class=MsoNormal style="MARGIN: 6pt 0in 3pt 11.35pt"&gt;&lt;SPAN style="mso-ansi-language: EN-US; mso-fareast-language: EN-US"&gt;sys.dm_db_missing_index_group_stats &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" style="BORDER-RIGHT: #f0f0f0; PADDING-RIGHT: 0in; BORDER-TOP: #f0f0f0; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: #f0f0f0; PADDING-TOP: 0in; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: transparent"&gt;
&lt;P class=MsoNormal style="MARGIN: 6pt 0in 3pt 11.35pt"&gt;&lt;SPAN style="mso-ansi-language: EN-US; mso-fareast-language: EN-US"&gt;Returns summary information about missing index groups, for example, the performance improvements that could be gained by implementing a specific group of missing indexes.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR style="mso-yfti-irow: 2"&gt;
&lt;TD class="" style="BORDER-RIGHT: #f0f0f0; PADDING-RIGHT: 0in; BORDER-TOP: #f0f0f0; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: #f0f0f0; PADDING-TOP: 0in; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: transparent"&gt;
&lt;P class=MsoNormal style="MARGIN: 6pt 0in 3pt 11.35pt"&gt;&lt;SPAN style="mso-ansi-language: EN-US; mso-fareast-language: EN-US"&gt;sys.dm_db_missing_index_groups &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" style="BORDER-RIGHT: #f0f0f0; PADDING-RIGHT: 0in; BORDER-TOP: #f0f0f0; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: #f0f0f0; PADDING-TOP: 0in; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: transparent"&gt;
&lt;P class=MsoNormal style="MARGIN: 6pt 0in 3pt 11.35pt"&gt;&lt;SPAN style="mso-ansi-language: EN-US; mso-fareast-language: EN-US"&gt;Returns information about a specific group of missing indexes, such as the group identifier and the identifiers of all missing indexes that are contained in that group.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR style="mso-yfti-irow: 3"&gt;
&lt;TD class="" style="BORDER-RIGHT: #f0f0f0; PADDING-RIGHT: 0in; BORDER-TOP: #f0f0f0; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: #f0f0f0; PADDING-TOP: 0in; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: transparent"&gt;
&lt;P class=MsoNormal style="MARGIN: 6pt 0in 3pt 11.35pt"&gt;&lt;SPAN style="mso-ansi-language: EN-US; mso-fareast-language: EN-US"&gt;sys.dm_db_missing_index_details &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" style="BORDER-RIGHT: #f0f0f0; PADDING-RIGHT: 0in; BORDER-TOP: #f0f0f0; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: #f0f0f0; PADDING-TOP: 0in; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: transparent"&gt;
&lt;P class=MsoNormal style="MARGIN: 6pt 0in 3pt 11.35pt"&gt;&lt;SPAN style="mso-ansi-language: EN-US; mso-fareast-language: EN-US"&gt;Returns detailed information about a missing index; for example, it returns the name and identifier of the table where the index is missing, and the columns and column types that should make up the missing index.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR style="mso-yfti-irow: 4"&gt;
&lt;TD class="" style="BORDER-RIGHT: #f0f0f0; PADDING-RIGHT: 0in; BORDER-TOP: #f0f0f0; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: #f0f0f0; PADDING-TOP: 0in; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: transparent"&gt;
&lt;P class=MsoNormal style="MARGIN: 6pt 0in 3pt 11.35pt"&gt;&lt;SPAN style="mso-ansi-language: EN-US; mso-fareast-language: EN-US"&gt;sys.dm_db_missing_index_columns &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" style="BORDER-RIGHT: #f0f0f0; PADDING-RIGHT: 0in; BORDER-TOP: #f0f0f0; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: #f0f0f0; PADDING-TOP: 0in; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: transparent"&gt;
&lt;P class=MsoNormal style="MARGIN: 6pt 0in 3pt 11.35pt"&gt;&lt;SPAN style="mso-ansi-language: EN-US; mso-fareast-language: EN-US"&gt;Returns information about the database table columns that are missing an index.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR style="mso-yfti-irow: 5"&gt;
&lt;TD class="" style="BORDER-RIGHT: #dedfef 1pt solid; PADDING-RIGHT: 3.75pt; BORDER-TOP: #dedfef 1pt solid; PADDING-LEFT: 3.75pt; BACKGROUND: #d8d8d8; PADDING-BOTTOM: 0in; BORDER-LEFT: #dedfef 1pt solid; PADDING-TOP: 0in; BORDER-BOTTOM: #dedfef 1pt solid; mso-border-alt: solid #DEDFEF .75pt" colSpan=2&gt;
&lt;P class=MsoNormal style="MARGIN: 6pt 0in 3pt 11.35pt"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;&lt;SPAN style="mso-ansi-language: EN-US; mso-fareast-language: EN-US"&gt;Note: &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/B&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR style="mso-yfti-irow: 6; mso-yfti-lastrow: yes"&gt;
&lt;TD class="" style="BORDER-RIGHT: #dedfef 1pt solid; PADDING-RIGHT: 3.75pt; BORDER-TOP: #dedfef 1pt solid; PADDING-LEFT: 3.75pt; BACKGROUND: white; PADDING-BOTTOM: 0in; BORDER-LEFT: #dedfef 1pt solid; PADDING-TOP: 0in; BORDER-BOTTOM: #dedfef 1pt solid; mso-border-alt: solid #DEDFEF .75pt" colSpan=2&gt;
&lt;P class=MsoNormal style="MARGIN: 6pt 0in 3pt 11.35pt"&gt;&lt;SPAN style="mso-ansi-language: EN-US; mso-fareast-language: EN-US"&gt;When the metadata for a table changes, all missing index information about that table is deleted from these dynamic management objects. Table metadata changes can occur when columns are added or dropped from a table, for example, or when an index is created on a column of a table.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;
&lt;P class=MsoNormal style="MARGIN: 6pt 0in 3pt 11.35pt"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;&lt;SPAN lang=EN-AU&gt;When SQL Server is restarted, all of the missing index information is dropped.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 6pt 0in 3pt 11.35pt"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;&lt;SPAN style="FONT-SIZE: 11pt; LINE-HEIGHT: 110%; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'; mso-bidi-font-size: 10.0pt"&gt;Example using DMVs: &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 6pt 0in 3pt 11.35pt"&gt;&lt;SPAN style="mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'"&gt;Query:&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 6pt 0in 3pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;SELECT&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: 'Courier New'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt; mig&lt;SPAN style="COLOR: gray"&gt;.&lt;/SPAN&gt;index_group_handle&lt;SPAN style="COLOR: gray"&gt;,&lt;/SPAN&gt;mid&lt;SPAN style="COLOR: gray"&gt;.&lt;/SPAN&gt;index_handle&lt;SPAN style="COLOR: gray"&gt;,&lt;/SPAN&gt; migs&lt;SPAN style="COLOR: gray"&gt;.&lt;/SPAN&gt;avg_total_user_cost &lt;SPAN style="COLOR: blue"&gt;as&lt;/SPAN&gt; AvgTotalUserCostThatCouldbeReduced&lt;SPAN style="COLOR: gray"&gt;,&lt;/SPAN&gt; migs&lt;SPAN style="COLOR: gray"&gt;.&lt;/SPAN&gt;avg_user_impact &lt;SPAN style="COLOR: blue"&gt;as&lt;/SPAN&gt; AvgPercentageBenefit&lt;SPAN style="COLOR: gray"&gt;,&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 6pt 0in 3pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: red; FONT-FAMILY: 'Courier New'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;'CREATE INDEX missing_index_'&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: 'Courier New'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt; &lt;SPAN style="COLOR: gray"&gt;+&lt;/SPAN&gt; &lt;SPAN style="COLOR: fuchsia"&gt;CONVERT&lt;/SPAN&gt; &lt;SPAN style="COLOR: gray"&gt;(&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;varchar&lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;,&lt;/SPAN&gt; mig&lt;SPAN style="COLOR: gray"&gt;.&lt;/SPAN&gt;index_group_handle&lt;SPAN style="COLOR: gray"&gt;)&lt;/SPAN&gt; &lt;SPAN style="COLOR: gray"&gt;+&lt;/SPAN&gt; &lt;SPAN style="COLOR: red"&gt;'_'&lt;/SPAN&gt; &lt;SPAN style="COLOR: gray"&gt;+&lt;/SPAN&gt; &lt;SPAN style="COLOR: fuchsia"&gt;CONVERT&lt;/SPAN&gt; &lt;SPAN style="COLOR: gray"&gt;(&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;varchar&lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;,&lt;/SPAN&gt; mid&lt;SPAN style="COLOR: gray"&gt;.&lt;/SPAN&gt;index_handle&lt;SPAN style="COLOR: gray"&gt;)&lt;/SPAN&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 6pt 0in 3pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: 'Courier New'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;+&lt;/SPAN&gt; &lt;SPAN style="COLOR: red"&gt;' ON '&lt;/SPAN&gt; &lt;SPAN style="COLOR: gray"&gt;+&lt;/SPAN&gt; mid&lt;SPAN style="COLOR: gray"&gt;.&lt;/SPAN&gt;statement &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 6pt 0in 3pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: 'Courier New'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;+&lt;/SPAN&gt; &lt;SPAN style="COLOR: red"&gt;' ('&lt;/SPAN&gt; &lt;SPAN style="COLOR: gray"&gt;+&lt;/SPAN&gt; &lt;SPAN style="COLOR: fuchsia"&gt;ISNULL&lt;/SPAN&gt; &lt;SPAN style="COLOR: gray"&gt;(&lt;/SPAN&gt;mid&lt;SPAN style="COLOR: gray"&gt;.&lt;/SPAN&gt;equality_columns&lt;SPAN style="COLOR: gray"&gt;,&lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;''&lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;)&lt;/SPAN&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 6pt 0in 3pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: 'Courier New'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;+&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;CASE&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;WHEN&lt;/SPAN&gt; mid&lt;SPAN style="COLOR: gray"&gt;.&lt;/SPAN&gt;equality_columns &lt;SPAN style="COLOR: gray"&gt;IS&lt;/SPAN&gt; &lt;SPAN style="COLOR: gray"&gt;NOT&lt;/SPAN&gt; &lt;SPAN style="COLOR: gray"&gt;NULL&lt;/SPAN&gt; &lt;SPAN style="COLOR: gray"&gt;AND&lt;/SPAN&gt; mid&lt;SPAN style="COLOR: gray"&gt;.&lt;/SPAN&gt;inequality_columns &lt;SPAN style="COLOR: gray"&gt;IS&lt;/SPAN&gt; &lt;SPAN style="COLOR: gray"&gt;NOT&lt;/SPAN&gt; &lt;SPAN style="COLOR: gray"&gt;NULL&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;THEN&lt;/SPAN&gt; &lt;SPAN style="COLOR: red"&gt;','&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;ELSE&lt;/SPAN&gt; &lt;SPAN style="COLOR: red"&gt;''&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;END&lt;/SPAN&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 6pt 0in 3pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: 'Courier New'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;+&lt;/SPAN&gt; &lt;SPAN style="COLOR: fuchsia"&gt;ISNULL&lt;/SPAN&gt; &lt;SPAN style="COLOR: gray"&gt;(&lt;/SPAN&gt;mid&lt;SPAN style="COLOR: gray"&gt;.&lt;/SPAN&gt;inequality_columns&lt;SPAN style="COLOR: gray"&gt;,&lt;/SPAN&gt; &lt;SPAN style="COLOR: red"&gt;''&lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 6pt 0in 3pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: 'Courier New'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;+&lt;/SPAN&gt; &lt;SPAN style="COLOR: red"&gt;')'&lt;/SPAN&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 6pt 0in 3pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: 'Courier New'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;+&lt;/SPAN&gt; &lt;SPAN style="COLOR: fuchsia"&gt;ISNULL&lt;/SPAN&gt; &lt;SPAN style="COLOR: gray"&gt;(&lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;' INCLUDE ('&lt;/SPAN&gt; &lt;SPAN style="COLOR: gray"&gt;+&lt;/SPAN&gt; mid&lt;SPAN style="COLOR: gray"&gt;.&lt;/SPAN&gt;included_columns &lt;SPAN style="COLOR: gray"&gt;+&lt;/SPAN&gt; &lt;SPAN style="COLOR: red"&gt;')'&lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;,&lt;/SPAN&gt; &lt;SPAN style="COLOR: red"&gt;''&lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;)&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;AS&lt;/SPAN&gt; create_index_statement &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 6pt 0in 3pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: 'Courier New'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;FROM&lt;/SPAN&gt; &lt;SPAN style="COLOR: green"&gt;sys.dm_db_missing_index_groups&lt;/SPAN&gt; mig&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 6pt 0in 3pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: gray; FONT-FAMILY: 'Courier New'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;INNER&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: 'Courier New'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt; &lt;SPAN style="COLOR: gray"&gt;JOIN&lt;/SPAN&gt; &lt;SPAN style="COLOR: green"&gt;sys.dm_db_missing_index_group_stats&lt;/SPAN&gt; migs &lt;SPAN style="COLOR: blue"&gt;ON&lt;/SPAN&gt; migs&lt;SPAN style="COLOR: gray"&gt;.&lt;/SPAN&gt;group_handle &lt;SPAN style="COLOR: gray"&gt;=&lt;/SPAN&gt; mig&lt;SPAN style="COLOR: gray"&gt;.&lt;/SPAN&gt;index_group_handle&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 6pt 0in 3pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: gray; FONT-FAMILY: 'Courier New'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;INNER&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: 'Courier New'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt; &lt;SPAN style="COLOR: gray"&gt;JOIN&lt;/SPAN&gt; &lt;SPAN style="COLOR: green"&gt;sys.dm_db_missing_index_details&lt;/SPAN&gt; mid &lt;SPAN style="COLOR: blue"&gt;ON&lt;/SPAN&gt; mig&lt;SPAN style="COLOR: gray"&gt;.&lt;/SPAN&gt;index_handle &lt;SPAN style="COLOR: gray"&gt;=&lt;/SPAN&gt; mid&lt;SPAN style="COLOR: gray"&gt;.&lt;/SPAN&gt;index_handle&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 6pt 0in 3pt 11.35pt"&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: blue; LINE-HEIGHT: 110%; FONT-FAMILY: 'Courier New'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;--where&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; LINE-HEIGHT: 110%; FONT-FAMILY: 'Courier New'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt; &lt;SPAN style="COLOR: blue"&gt;statement&lt;/SPAN&gt; &lt;SPAN style="COLOR: gray"&gt;=&lt;/SPAN&gt; &lt;SPAN style="COLOR: red"&gt;'[&amp;lt;DBName&amp;gt;].[dbo].[&amp;lt;TableName&amp;gt;]'&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; LINE-HEIGHT: 110%; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'; mso-bidi-font-size: 10.0pt"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;Finding Unused Indexes:&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 6pt 0in 3pt 11.35pt"&gt;&lt;SPAN lang=EN-AU&gt;DMVs used: sys.dm_db_index_usage_stats&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 6pt 0in 3pt 11.35pt"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;&lt;SPAN lang=EN-AU&gt;Example to find Unused Indexes:&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="COLOR: blue; FONT-FAMILY: 'Courier New'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-no-proof: yes"&gt;select&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-no-proof: yes"&gt; &lt;SPAN style="COLOR: fuchsia"&gt;object_name&lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;(&lt;/SPAN&gt;i&lt;SPAN style="COLOR: gray"&gt;.&lt;/SPAN&gt;&lt;SPAN style="COLOR: fuchsia"&gt;object_id&lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;)&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;as&lt;/SPAN&gt; ObjectName&lt;SPAN style="COLOR: gray"&gt;,&lt;/SPAN&gt; i&lt;SPAN style="COLOR: gray"&gt;.&lt;/SPAN&gt;name &lt;SPAN style="COLOR: blue"&gt;as&lt;/SPAN&gt; [Unused Index]&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="COLOR: blue; FONT-FAMILY: 'Courier New'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-no-proof: yes"&gt;from&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-no-proof: yes"&gt; &lt;SPAN style="COLOR: green"&gt;sys.indexes&lt;/SPAN&gt; i&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="COLOR: gray; FONT-FAMILY: 'Courier New'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-no-proof: yes"&gt;left&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-no-proof: yes"&gt; &lt;SPAN style="COLOR: gray"&gt;join&lt;/SPAN&gt; &lt;SPAN style="COLOR: green"&gt;sys.dm_db_index_usage_stats&lt;/SPAN&gt; s &lt;SPAN style="COLOR: blue"&gt;on&lt;/SPAN&gt; s&lt;SPAN style="COLOR: gray"&gt;.&lt;/SPAN&gt;&lt;SPAN style="COLOR: fuchsia"&gt;object_id&lt;/SPAN&gt; &lt;SPAN style="COLOR: gray"&gt;=&lt;/SPAN&gt; i&lt;SPAN style="COLOR: gray"&gt;.&lt;/SPAN&gt;&lt;SPAN style="COLOR: fuchsia"&gt;object_id&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;and&lt;/SPAN&gt; i&lt;SPAN style="COLOR: gray"&gt;.&lt;/SPAN&gt;index_id &lt;SPAN style="COLOR: gray"&gt;=&lt;/SPAN&gt; s&lt;SPAN style="COLOR: gray"&gt;.&lt;/SPAN&gt;index_id&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;and&lt;/SPAN&gt; s&lt;SPAN style="COLOR: gray"&gt;.&lt;/SPAN&gt;database_id &lt;SPAN style="COLOR: gray"&gt;=&lt;/SPAN&gt; &lt;SPAN style="COLOR: fuchsia"&gt;db_id&lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;()&lt;/SPAN&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="COLOR: blue; FONT-FAMILY: 'Courier New'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-no-proof: yes"&gt;where&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-no-proof: yes"&gt; &lt;SPAN style="COLOR: fuchsia"&gt;objectproperty&lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;(&lt;/SPAN&gt;i&lt;SPAN style="COLOR: gray"&gt;.&lt;/SPAN&gt;&lt;SPAN style="COLOR: fuchsia"&gt;object_id&lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;,&lt;/SPAN&gt; &lt;SPAN style="COLOR: red"&gt;'IsIndexable'&lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;)&lt;/SPAN&gt; &lt;SPAN style="COLOR: gray"&gt;=&lt;/SPAN&gt; 1&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="COLOR: gray; FONT-FAMILY: 'Courier New'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-no-proof: yes"&gt;AND&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-no-proof: yes"&gt; &lt;SPAN style="COLOR: fuchsia"&gt;objectproperty&lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;(&lt;/SPAN&gt;i&lt;SPAN style="COLOR: gray"&gt;.&lt;/SPAN&gt;&lt;SPAN style="COLOR: fuchsia"&gt;object_id&lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;,&lt;/SPAN&gt; &lt;SPAN style="COLOR: red"&gt;'IsIndexed'&lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;)&lt;/SPAN&gt; &lt;SPAN style="COLOR: gray"&gt;=&lt;/SPAN&gt; 1 &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="COLOR: gray; FONT-FAMILY: 'Courier New'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-no-proof: yes"&gt;and&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-no-proof: yes"&gt; s&lt;SPAN style="COLOR: gray"&gt;.&lt;/SPAN&gt;index_id &lt;SPAN style="COLOR: gray"&gt;is&lt;/SPAN&gt; &lt;SPAN style="COLOR: gray"&gt;null&lt;/SPAN&gt; &lt;SPAN style="COLOR: green"&gt;-- and dm_db_index_usage_stats has no reference to this index&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="COLOR: gray; FONT-FAMILY: 'Courier New'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-no-proof: yes"&gt;or&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-no-proof: yes"&gt; &lt;SPAN style="COLOR: gray"&gt;(&lt;/SPAN&gt;s&lt;SPAN style="COLOR: gray"&gt;.&lt;/SPAN&gt;user_updates &lt;SPAN style="COLOR: gray"&gt;&amp;gt;&lt;/SPAN&gt; 0 &lt;SPAN style="COLOR: gray"&gt;and&lt;/SPAN&gt; s&lt;SPAN style="COLOR: gray"&gt;.&lt;/SPAN&gt;user_seeks &lt;SPAN style="COLOR: gray"&gt;=&lt;/SPAN&gt; 0 &lt;SPAN style="COLOR: gray"&gt;and&lt;/SPAN&gt; s&lt;SPAN style="COLOR: gray"&gt;.&lt;/SPAN&gt;user_scans &lt;SPAN style="COLOR: gray"&gt;=&lt;/SPAN&gt; 0 &lt;SPAN style="COLOR: gray"&gt;and&lt;/SPAN&gt; s&lt;SPAN style="COLOR: gray"&gt;.&lt;/SPAN&gt;user_lookups &lt;SPAN style="COLOR: gray"&gt;=&lt;/SPAN&gt; 0&lt;SPAN style="COLOR: gray"&gt;)&lt;/SPAN&gt; &lt;SPAN style="COLOR: green"&gt;-- index is being updated, but not used by seeks/scans/lookups&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 6pt 0in 3pt 11.35pt"&gt;&lt;SPAN style="COLOR: blue; FONT-FAMILY: 'Courier New'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-no-proof: yes"&gt;order&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-no-proof: yes"&gt; &lt;SPAN style="COLOR: blue"&gt;by&lt;/SPAN&gt; &lt;SPAN style="COLOR: fuchsia"&gt;object_name&lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;(&lt;/SPAN&gt;i&lt;SPAN style="COLOR: gray"&gt;.&lt;/SPAN&gt;&lt;SPAN style="COLOR: fuchsia"&gt;object_id&lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;)&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;asc&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="mso-ansi-language: EN-US"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 6pt 0in 3pt 11.35pt"&gt;&lt;SPAN style="mso-ansi-language: EN-US"&gt;In the above query, &lt;B style="mso-bidi-font-weight: normal"&gt;user_seeks&lt;/B&gt;, &lt;B style="mso-bidi-font-weight: normal"&gt;user_scans&lt;/B&gt;, and &lt;B style="mso-bidi-font-weight: normal"&gt;user_lookups&lt;/B&gt; counters indicate the usage of the particular index.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;If the value of the counters is 0, it means that index has never been used for any Seek, or Scan or Lookup operations.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 6pt 0in 3pt 11.35pt"&gt;&lt;SPAN lang=EN-AU&gt;Every individual seek, scan, lookup, or update on the specified index by one query execution is counted as a use of that index and increments the corresponding counter in this view (DMV). &lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 6pt 0in 3pt 11.35pt"&gt;&lt;SPAN lang=EN-AU&gt;The &lt;B&gt;user_updates&lt;/B&gt; counter indicates the level of maintenance on the index caused by insert, update, or delete operations on the underlying table or view. &lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 6pt 0in 3pt 11.35pt"&gt;&lt;SPAN lang=EN-AU&gt;The counters are initialized to empty whenever the SQL Server (MSSQLSERVER) service is started. In addition, whenever a database is detached or is shut down (for example, because AUTO_CLOSE is set to ON), all rows associated with the database are removed. &lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 6pt 0in 3pt 11.35pt"&gt;&lt;SPAN lang=EN-AU&gt;When an index is used, a row is added to &lt;B&gt;sys.dm_db_index_usage_stats&lt;/B&gt; if a row does not already exist for the index. When the row is added, its counters are initially set to zero.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=2609045" width="1" height="1"&gt;</content><author><name>vishah</name><uri>http://blogs.technet.com/members/vishah.aspx</uri></author><category term="Missing Indexes DMVs" scheme="http://blogs.technet.com/vipulshah/archive/tags/Missing+Indexes+DMVs/default.aspx" /></entry><entry><title>DDL Triggers and LOGON Triggers</title><link rel="alternate" type="text/html" href="http://blogs.technet.com/vipulshah/archive/2007/12/04/ddl-triggers-and-logon-triggers.aspx" /><id>http://blogs.technet.com/vipulshah/archive/2007/12/04/ddl-triggers-and-logon-triggers.aspx</id><published>2007-12-05T00:16:00Z</published><updated>2007-12-05T00:16:00Z</updated><content type="html">&lt;P class=MsoNormal style="MARGIN: 6pt 0in 3pt 11.35pt"&gt;&lt;SPAN style="mso-ansi-language: EN-US; mso-fareast-language: EN-US"&gt;&lt;STRONG&gt;&lt;U&gt;DDL Triggers:&lt;/U&gt;&lt;/STRONG&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 6pt 0in 3pt 11.35pt"&gt;&lt;SPAN style="mso-ansi-language: EN-US; mso-fareast-language: EN-US"&gt;DDL triggers can be used for administrative tasks such as auditing and regulating database operations. Use DDL triggers when you want to do the following: &lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 6pt 0in 3pt 45.35pt; TEXT-INDENT: -17pt; mso-list: l0 level1 lfo1; tab-stops: list 45.35pt"&gt;&lt;SPAN style="COLOR: gray; FONT-FAMILY: 'Wingdings 2'; mso-fareast-font-family: 'Wingdings 2'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-font-family: 'Wingdings 2'"&gt;&lt;SPAN style="mso-list: Ignore"&gt;¾&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="mso-ansi-language: EN-US; mso-fareast-language: EN-US"&gt;You want to prevent certain changes to your database schema.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 6pt 0in 3pt 45.35pt; TEXT-INDENT: -17pt; mso-list: l0 level1 lfo1; tab-stops: list 45.35pt"&gt;&lt;SPAN style="COLOR: gray; FONT-FAMILY: 'Wingdings 2'; mso-fareast-font-family: 'Wingdings 2'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-font-family: 'Wingdings 2'"&gt;&lt;SPAN style="mso-list: Ignore"&gt;¾&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="mso-ansi-language: EN-US; mso-fareast-language: EN-US"&gt;You want something to occur in the database in response to a change in your database schema. &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 6pt 0in 3pt 45.35pt; TEXT-INDENT: -17pt; mso-list: l0 level1 lfo1; tab-stops: list 45.35pt"&gt;&lt;SPAN style="COLOR: gray; FONT-FAMILY: 'Wingdings 2'; mso-fareast-font-family: 'Wingdings 2'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-font-family: 'Wingdings 2'"&gt;&lt;SPAN style="mso-list: Ignore"&gt;¾&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="mso-ansi-language: EN-US; mso-fareast-language: EN-US"&gt;You want to record changes or events in the database schema.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 6pt 0in 3pt 11.35pt"&gt;&lt;SPAN style="mso-ansi-language: EN-US; mso-fareast-language: EN-US"&gt;DDL triggers fire only after the DDL statements that trigger them are run. DDL triggers cannot be used as INSTEAD OF triggers.&lt;/SPAN&gt;&lt;/P&gt;&lt;SPAN style="mso-ansi-language: EN-US; mso-fareast-language: EN-US"&gt;
&lt;P class=MsoNormal style="MARGIN: 6pt 0in 3pt 11.35pt"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;&lt;SPAN lang=EN-AU style="FONT-SIZE: 11pt; LINE-HEIGHT: 110%; mso-bidi-font-size: 10.0pt"&gt;Example of DDL Trigger:&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 6pt 0in 3pt 11.35pt"&gt;&lt;SPAN lang=EN-AU&gt;This example tracks the Login Events on a server level.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;It uses DDL_LOGIN_EVENTS event group from server scope events from above diagram.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;It fires against DDL Login activities such as CREATE, ALTER, DROP Login.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 6pt 0in 3pt 11.35pt"&gt;&lt;SPAN lang=EN-AU&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;CREATE&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt; &lt;SPAN style="COLOR: blue"&gt;Trigger&lt;/SPAN&gt; [Trg_TrackLoginManagement]&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;on&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt; &lt;SPAN style="COLOR: gray"&gt;ALL&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;Server&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;for&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt; DDL_LOGIN_EVENTS&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;as&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;set&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt; &lt;SPAN style="COLOR: blue"&gt;nocount&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;on&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;declare&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt; @data &lt;SPAN style="COLOR: blue"&gt;xml&lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;,&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-tab-count: 2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;@EventType &lt;SPAN style="COLOR: blue"&gt;varchar&lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;(&lt;/SPAN&gt;100&lt;SPAN style="COLOR: gray"&gt;),&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-tab-count: 2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;@EventTime &lt;SPAN style="COLOR: blue"&gt;datetime&lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;,&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-tab-count: 2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;@ServerName &lt;SPAN style="COLOR: blue"&gt;varchar&lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;(&lt;/SPAN&gt;100&lt;SPAN style="COLOR: gray"&gt;),&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-tab-count: 2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;@AffectedLoginName &lt;SPAN style="COLOR: blue"&gt;varchar&lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;(&lt;/SPAN&gt;100&lt;SPAN style="COLOR: gray"&gt;),&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-tab-count: 2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;@WhoDidIt &lt;SPAN style="COLOR: blue"&gt;varchar&lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;(&lt;/SPAN&gt;100&lt;SPAN style="COLOR: gray"&gt;),&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-tab-count: 2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;@EmailSubject &lt;SPAN style="COLOR: blue"&gt;varchar&lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;(&lt;/SPAN&gt;500&lt;SPAN style="COLOR: gray"&gt;),&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-tab-count: 2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;@EmailBody &lt;SPAN style="COLOR: blue"&gt;varchar&lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;(&lt;/SPAN&gt;800&lt;SPAN style="COLOR: gray"&gt;),&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-tab-count: 2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;@EmailRecipients &lt;SPAN style="COLOR: blue"&gt;varchar&lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;(&lt;/SPAN&gt;300&lt;SPAN style="COLOR: gray"&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: gray; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;set&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt; @EmailRecipients &lt;SPAN style="COLOR: gray"&gt;=&lt;/SPAN&gt; &lt;SPAN style="COLOR: red"&gt;&lt;A href="mailto:'DBAS@microsoft.com'"&gt;'DBAS@microsoft.com'&lt;/A&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: red; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;set&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt; @data &lt;SPAN style="COLOR: gray"&gt;=&lt;/SPAN&gt; &lt;SPAN style="COLOR: fuchsia"&gt;eventdata&lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;()&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;set&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt; @EventType &lt;SPAN style="COLOR: gray"&gt;=&lt;/SPAN&gt; @data&lt;SPAN style="COLOR: gray"&gt;.&lt;/SPAN&gt;value&lt;SPAN style="COLOR: gray"&gt;(&lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;'(/EVENT_INSTANCE/EventType)[1]'&lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;,&lt;/SPAN&gt; &lt;SPAN style="COLOR: red"&gt;'varchar(100)'&lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;set&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt; @EventTime &lt;SPAN style="COLOR: gray"&gt;=&lt;/SPAN&gt; @data&lt;SPAN style="COLOR: gray"&gt;.&lt;/SPAN&gt;value&lt;SPAN style="COLOR: gray"&gt;(&lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;'(/EVENT_INSTANCE/PostTime)[1]'&lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;,&lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;'datetime'&lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;set&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt; @ServerName &lt;SPAN style="COLOR: gray"&gt;=&lt;/SPAN&gt; @data&lt;SPAN style="COLOR: gray"&gt;.&lt;/SPAN&gt;value&lt;SPAN style="COLOR: gray"&gt;(&lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;'(/EVENT_INSTANCE/ServerName)[1]'&lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;,&lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;'varchar(100)'&lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;set&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt; @AffectedLoginName &lt;SPAN style="COLOR: gray"&gt;=&lt;/SPAN&gt; @data&lt;SPAN style="COLOR: gray"&gt;.&lt;/SPAN&gt;value&lt;SPAN style="COLOR: gray"&gt;(&lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;'(/EVENT_INSTANCE/ObjectName)[1]'&lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;,&lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;'varchar(100)'&lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;set&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt; @WhoDidIt &lt;SPAN style="COLOR: gray"&gt;=&lt;/SPAN&gt; @data&lt;SPAN style="COLOR: gray"&gt;.&lt;/SPAN&gt;value&lt;SPAN style="COLOR: gray"&gt;(&lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;'(/EVENT_INSTANCE/LoginName)[1]'&lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;,&lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;'varchar(100)'&lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: gray; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;insert&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt; &lt;SPAN style="COLOR: blue"&gt;into&lt;/SPAN&gt; msdb&lt;SPAN style="COLOR: gray"&gt;..&lt;/SPAN&gt;TrackLoginManagement &lt;SPAN style="COLOR: blue"&gt;values&lt;/SPAN&gt; &lt;SPAN style="COLOR: gray"&gt;(&lt;/SPAN&gt;@EventType&lt;SPAN style="COLOR: gray"&gt;,&lt;/SPAN&gt;@EventTime&lt;SPAN style="COLOR: gray"&gt;,&lt;/SPAN&gt;@ServerName&lt;SPAN style="COLOR: gray"&gt;,&lt;/SPAN&gt;@AffectedLoginName&lt;SPAN style="COLOR: gray"&gt;,&lt;/SPAN&gt;@WhoDidIt&lt;SPAN style="COLOR: gray"&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: gray; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;set&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt; @EmailSubject &lt;SPAN style="COLOR: gray"&gt;=&lt;/SPAN&gt; &lt;SPAN style="COLOR: red"&gt;'ALERT: DDL_LOGIN_Event: '&lt;/SPAN&gt; &lt;SPAN style="COLOR: gray"&gt;+&lt;/SPAN&gt; @EventType &lt;SPAN style="COLOR: gray"&gt;+&lt;/SPAN&gt; &lt;SPAN style="COLOR: red"&gt;' occured by '&lt;/SPAN&gt; &lt;SPAN style="COLOR: gray"&gt;+&lt;/SPAN&gt; @WhoDidIt &lt;SPAN style="COLOR: gray"&gt;+&lt;/SPAN&gt; &lt;SPAN style="COLOR: red"&gt;' on '&lt;/SPAN&gt; &lt;SPAN style="COLOR: gray"&gt;+&lt;/SPAN&gt; @ServerName&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 11.35pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;set&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt; @EmailBody &lt;SPAN style="COLOR: gray"&gt;=&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;'DDL_Login_Event: '&lt;/SPAN&gt; &lt;SPAN style="COLOR: gray"&gt;+&lt;/SPAN&gt; @EventType &lt;SPAN style="COLOR: gray"&gt;+&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;char&lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;(&lt;/SPAN&gt;10&lt;SPAN style="COLOR: gray"&gt;)&lt;/SPAN&gt; &lt;SPAN style="COLOR: gray"&gt;+&lt;/SPAN&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-tab-count: 3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;'Event Occured at: '&lt;/SPAN&gt; &lt;SPAN style="COLOR: gray"&gt;+&lt;/SPAN&gt; &lt;SPAN style="COLOR: fuchsia"&gt;convert&lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;(&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;Varchar&lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;,&lt;/SPAN&gt; @EventTime&lt;SPAN style="COLOR: gray"&gt;)&lt;/SPAN&gt; &lt;SPAN style="COLOR: gray"&gt;+&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;char&lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;(&lt;/SPAN&gt;10&lt;SPAN style="COLOR: gray"&gt;)&lt;/SPAN&gt; &lt;SPAN style="COLOR: gray"&gt;+&lt;/SPAN&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-tab-count: 3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;'ServerName: '&lt;/SPAN&gt; &lt;SPAN style="COLOR: gray"&gt;+&lt;/SPAN&gt; @ServerName &lt;SPAN style="COLOR: gray"&gt;+&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;char&lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;(&lt;/SPAN&gt;10&lt;SPAN style="COLOR: gray"&gt;)&lt;/SPAN&gt; &lt;SPAN style="COLOR: gray"&gt;+&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-tab-count: 3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;'Affected Login Name:&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;'&lt;/SPAN&gt; &lt;SPAN style="COLOR: gray"&gt;+&lt;/SPAN&gt; @AffectedLoginName &lt;SPAN style="COLOR: gray"&gt;+&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;char&lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;(&lt;/SPAN&gt;10&lt;SPAN style="COLOR: gray"&gt;)&lt;/SPAN&gt; &lt;SPAN style="COLOR: gray"&gt;+&lt;/SPAN&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-tab-count: 3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;'Event Done by: '&lt;/SPAN&gt; &lt;SPAN style="COLOR: gray"&gt;+&lt;/SPAN&gt; @WhoDidIt&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;EXEC&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt; msdb&lt;SPAN style="COLOR: gray"&gt;.&lt;/SPAN&gt;dbo&lt;SPAN style="COLOR: gray"&gt;.&lt;/SPAN&gt;sp_send_dbmail&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;@recipients &lt;SPAN style="COLOR: gray"&gt;=&lt;/SPAN&gt; @EmailRecipients&lt;SPAN style="COLOR: gray"&gt;,&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;@body &lt;SPAN style="COLOR: gray"&gt;=&lt;/SPAN&gt; @EmailBody&lt;SPAN style="COLOR: gray"&gt;,&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;@subject &lt;SPAN style="COLOR: gray"&gt;=&lt;/SPAN&gt; @EmailSubject &lt;SPAN style="COLOR: gray"&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: gray; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;print&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt; @Eventtype &lt;SPAN style="COLOR: gray"&gt;+&lt;/SPAN&gt; &lt;SPAN style="COLOR: red"&gt;' activity completed successfully.'&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 6pt 0in 3pt 11.35pt"&gt;&lt;SPAN style="FONT-SIZE: 8pt; LINE-HEIGHT: 110%; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;GO&lt;/SPAN&gt;&lt;SPAN lang=EN-AU style="FONT-SIZE: 8pt; LINE-HEIGHT: 110%; mso-bidi-font-size: 10.0pt"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 6pt 0in 3pt 11.35pt" mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 6pt 0in 3pt 11.35pt"&gt;&lt;STRONG&gt;&lt;U&gt;LOGON Triggers:&lt;/U&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;SPAN style="mso-ansi-language: EN-US; mso-fareast-language: EN-US"&gt;&lt;o:p&gt;
&lt;P class=MsoNormal style="MARGIN: 6pt 0in 3pt 11.35pt"&gt;&lt;SPAN lang=EN-AU&gt;Similar to DDL Triggers, LOGON Triggers fire stored procedures or T-SQL statements in response to LOGON events.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;Logon triggers fire after the authentication phase of logging in finishes, but before the user session is actually established. Therefore, all messages originating inside the trigger that would typically reach the user, such as error messages and messages from the PRINT statement, are diverted to the SQL Server error log. Logon triggers do not fire if authentication fails.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 6pt 0in 3pt 11.35pt"&gt;&lt;SPAN lang=EN-AU&gt;You can use logon triggers to audit and control server sessions, such as by tracking logon activity, restricting logons to SQL Server, or limiting the number of sessions for a specific logon.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 6pt 0in 3pt 11.35pt"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;&lt;SPAN lang=EN-AU style="FONT-SIZE: 11pt; LINE-HEIGHT: 110%; mso-bidi-font-size: 10.0pt"&gt;Example of LOGON Trigger:&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 6pt 0in 3pt 11.35pt"&gt;&lt;SPAN lang=EN-AU&gt;In the following code, the logon trigger captures information from EventData() functions such as LoginName, HostName, LoginTime, and LoginType when any logon activity happened by a SQL Login which are connecting from hosts other than application servers.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;This is useful to monitor people connecting to SQL Server using application ids during peak hours and possibly causing performance issues by running inefficient queries outside of an application.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 6pt 0in 3pt 11.35pt"&gt;&lt;SPAN lang=EN-AU&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;create&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt; &lt;SPAN style="COLOR: blue"&gt;table&lt;/SPAN&gt; myTest &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: gray; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;(&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;LogonTime &lt;SPAN style="COLOR: blue"&gt;datetime&lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;,&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;LoginName &lt;SPAN style="COLOR: blue"&gt;varchar&lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;(&lt;/SPAN&gt;50&lt;SPAN style="COLOR: gray"&gt;),&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;ClientHost &lt;SPAN style="COLOR: blue"&gt;varchar&lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;(&lt;/SPAN&gt;50&lt;SPAN style="COLOR: gray"&gt;),&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;LoginType &lt;SPAN style="COLOR: blue"&gt;varchar&lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;(&lt;/SPAN&gt;50&lt;SPAN style="COLOR: gray"&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: gray; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: gray; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;create&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt; &lt;SPAN style="COLOR: blue"&gt;TRIGGER&lt;/SPAN&gt; myTest_LogonTrigger&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;ON&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt; &lt;SPAN style="COLOR: gray"&gt;ALL&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;SERVER&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;WITH&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;EXECUTE&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;AS&lt;/SPAN&gt; &lt;SPAN style="COLOR: red"&gt;'sa'&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;FOR&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt; LOGON&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;AS&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;BEGIN&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;declare&lt;/SPAN&gt; @LogonTriggerData &lt;SPAN style="COLOR: blue"&gt;xml&lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;,&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-tab-count: 3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;@EventTime &lt;SPAN style="COLOR: blue"&gt;datetime&lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;,&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-tab-count: 3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;@LoginName &lt;SPAN style="COLOR: blue"&gt;varchar&lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;(&lt;/SPAN&gt;50&lt;SPAN style="COLOR: gray"&gt;),&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-tab-count: 3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;@HostName &lt;SPAN style="COLOR: blue"&gt;varchar&lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;(&lt;/SPAN&gt;50&lt;SPAN style="COLOR: gray"&gt;),&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-tab-count: 3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;@LoginType &lt;SPAN style="COLOR: blue"&gt;varchar&lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;(&lt;/SPAN&gt;50&lt;SPAN style="COLOR: gray"&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;set&lt;/SPAN&gt; @LogonTriggerData &lt;SPAN style="COLOR: gray"&gt;=&lt;/SPAN&gt; &lt;SPAN style="COLOR: fuchsia"&gt;eventdata&lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;()&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: gray; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;set&lt;/SPAN&gt; @EventTime &lt;SPAN style="COLOR: gray"&gt;=&lt;/SPAN&gt; @LogonTriggerData&lt;SPAN style="COLOR: gray"&gt;.&lt;/SPAN&gt;value&lt;SPAN style="COLOR: gray"&gt;(&lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;'(/EVENT_INSTANCE/PostTime)[1]'&lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;,&lt;/SPAN&gt; &lt;SPAN style="COLOR: red"&gt;'datetime'&lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;set&lt;/SPAN&gt; @LoginName &lt;SPAN style="COLOR: gray"&gt;=&lt;/SPAN&gt; @LogonTriggerData&lt;SPAN style="COLOR: gray"&gt;.&lt;/SPAN&gt;value&lt;SPAN style="COLOR: gray"&gt;(&lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;'(/EVENT_INSTANCE/LoginName)[1]'&lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;,&lt;/SPAN&gt; &lt;SPAN style="COLOR: red"&gt;'varchar(50)'&lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;set&lt;/SPAN&gt; @HostName &lt;SPAN style="COLOR: gray"&gt;=&lt;/SPAN&gt; @LogonTriggerData&lt;SPAN style="COLOR: gray"&gt;.&lt;/SPAN&gt;value&lt;SPAN style="COLOR: gray"&gt;(&lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;'(/EVENT_INSTANCE/ClientHost)[1]'&lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;,&lt;/SPAN&gt; &lt;SPAN style="COLOR: red"&gt;'varchar(50)'&lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;set&lt;/SPAN&gt; @LoginType &lt;SPAN style="COLOR: gray"&gt;=&lt;/SPAN&gt; @LogonTriggerData&lt;SPAN style="COLOR: gray"&gt;.&lt;/SPAN&gt;value&lt;SPAN style="COLOR: gray"&gt;(&lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;'(/EVENT_INSTANCE/LoginType)[1]'&lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;,&lt;/SPAN&gt; &lt;SPAN style="COLOR: red"&gt;'varchar(50)'&lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: gray; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;if&lt;/SPAN&gt; @LoginType &lt;SPAN style="COLOR: gray"&gt;=&lt;/SPAN&gt; &lt;SPAN style="COLOR: red"&gt;'SQL Login'&lt;/SPAN&gt; &lt;SPAN style="COLOR: gray"&gt;and&lt;/SPAN&gt; @HostName &lt;SPAN style="COLOR: gray"&gt;not&lt;/SPAN&gt; &lt;SPAN style="COLOR: gray"&gt;in&lt;/SPAN&gt; &lt;SPAN style="COLOR: gray"&gt;(&lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;'&amp;lt;comma separated list of hostname&amp;gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;)&lt;/SPAN&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-tab-count: 2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;and&lt;/SPAN&gt; @LoginName &lt;SPAN style="COLOR: gray"&gt;not&lt;/SPAN&gt; &lt;SPAN style="COLOR: gray"&gt;in&lt;/SPAN&gt; &lt;SPAN style="COLOR: gray"&gt;(&lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;'&amp;lt;comma separated list of SQL logins&amp;gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-tab-count: 2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;insert&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;into&lt;/SPAN&gt; master&lt;SPAN style="COLOR: gray"&gt;..&lt;/SPAN&gt;myTest &lt;SPAN style="COLOR: blue"&gt;values&lt;/SPAN&gt; &lt;SPAN style="COLOR: gray"&gt;(&lt;/SPAN&gt;@EventTime&lt;SPAN style="COLOR: gray"&gt;,&lt;/SPAN&gt; @LoginName&lt;SPAN style="COLOR: gray"&gt;,&lt;/SPAN&gt; @HostName&lt;SPAN style="COLOR: gray"&gt;,&lt;/SPAN&gt; @LoginType&lt;SPAN style="COLOR: gray"&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;end&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 6pt 0in 3pt 11.35pt"&gt;&lt;SPAN style="FONT-SIZE: 8pt; LINE-HEIGHT: 110%; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;go&lt;/SPAN&gt;&lt;SPAN lang=EN-AU style="FONT-SIZE: 8pt; LINE-HEIGHT: 110%; mso-bidi-font-size: 10.0pt"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 6pt 0in 3pt 11.35pt"&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=2609013" width="1" height="1"&gt;</content><author><name>vishah</name><uri>http://blogs.technet.com/members/vishah.aspx</uri></author><category term="LOGON Triggers" scheme="http://blogs.technet.com/vipulshah/archive/tags/LOGON+Triggers/default.aspx" /><category term="DDL Triggers" scheme="http://blogs.technet.com/vipulshah/archive/tags/DDL+Triggers/default.aspx" /></entry><entry><title>Plan Cache Analysis in SQL Server 2005</title><link rel="alternate" type="text/html" href="http://blogs.technet.com/vipulshah/archive/2007/09/24/notes-taken-during-pass-session-plan-cache-analysis-in-sql-server-2005.aspx" /><id>http://blogs.technet.com/vipulshah/archive/2007/09/24/notes-taken-during-pass-session-plan-cache-analysis-in-sql-server-2005.aspx</id><published>2007-09-25T07:16:00Z</published><updated>2007-09-25T07:16:00Z</updated><content type="html">&lt;P&gt;Plan Cache: The portion of the memory pool allocated to store Query execution Plan&lt;/P&gt;
&lt;P&gt;For how much memory is allocated for Plan Cache in different version of SQL server, please refer to my blog: - &lt;A href="http://blogs.technet.com/vipulshah/archive/2007/09/24/understanding-query-plan-cache-in-sql-2005-sp2-why-it-s-changed-from-sql-2005-rtm-sp1.aspx" mce_href="http://blogs.technet.com/vipulshah/archive/2007/09/24/understanding-query-plan-cache-in-sql-2005-sp2-why-it-s-changed-from-sql-2005-rtm-sp1.aspx"&gt;Understanding Query Plan Cache in SQL 2005 SP2 - why it's changed from SQL 2005 RTM/SP1?&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;A stored execution plan can be one of the following:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Compiled – the actual instructions describing how SQL Server will implement a query &lt;/LI&gt;
&lt;LI&gt;Execution Context – run-time information unique to a user: 
&lt;UL&gt;
&lt;LI&gt;Values of local variables &lt;/LI&gt;
&lt;LI&gt;Object ID’s of temporary objects &lt;/LI&gt;
&lt;LI&gt;Which statement currently being executed &lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;
&lt;LI&gt;Cursors – execution state of server-side cursors &lt;/LI&gt;
&lt;LI&gt;Parse Tree – Aids in parsing the query. Usually not cached. &lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;In SQL Server 2005 there are four major DMVs which can be very useful in Plan Cache Analysis:&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;1. sys.dm_exec_requests&lt;/STRONG&gt;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;shows information about all running processes (similar to sysprocesses in SQL 2000) along with sql_handle, and plan_handle which can be utilized as an input in following DMVs &lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;example: &lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 9pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;SELECT&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;sder&lt;SPAN style="COLOR: gray"&gt;.&lt;/SPAN&gt;session_id &lt;SPAN style="COLOR: blue"&gt;AS&lt;/SPAN&gt; [SPID]&lt;SPAN style="COLOR: gray"&gt;,&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;sder&lt;SPAN style="COLOR: gray"&gt;.&lt;/SPAN&gt;sql_handle &lt;SPAN style="COLOR: blue"&gt;as&lt;/SPAN&gt; [SQL_Handle]&lt;SPAN style="COLOR: gray"&gt;,&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;sder&lt;SPAN style="COLOR: gray"&gt;.&lt;/SPAN&gt;plan_handle &lt;SPAN style="COLOR: blue"&gt;as&lt;/SPAN&gt; [PLAN_Handle]&lt;SPAN style="COLOR: gray"&gt;,&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;sdes&lt;SPAN style="COLOR: gray"&gt;.&lt;/SPAN&gt;login_name &lt;SPAN style="COLOR: blue"&gt;AS&lt;/SPAN&gt; [Login]&lt;SPAN style="COLOR: gray"&gt;,&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;sd&lt;SPAN style="COLOR: gray"&gt;.&lt;/SPAN&gt;name &lt;SPAN style="COLOR: blue"&gt;AS&lt;/SPAN&gt; [DBName]&lt;SPAN style="COLOR: gray"&gt;,&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;sder&lt;SPAN style="COLOR: gray"&gt;.&lt;/SPAN&gt;start_time &lt;SPAN style="COLOR: blue"&gt;AS&lt;/SPAN&gt; [Start Time]&lt;SPAN style="COLOR: gray"&gt;,&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;sder&lt;SPAN style="COLOR: gray"&gt;.&lt;/SPAN&gt;status &lt;SPAN style="COLOR: blue"&gt;AS&lt;/SPAN&gt; [Status]&lt;SPAN style="COLOR: gray"&gt;,&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;sder&lt;SPAN style="COLOR: gray"&gt;.&lt;/SPAN&gt;command &lt;SPAN style="COLOR: blue"&gt;AS&lt;/SPAN&gt; [Command]&lt;SPAN style="COLOR: gray"&gt;,&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;sdet&lt;SPAN style="COLOR: gray"&gt;.&lt;/SPAN&gt;text &lt;SPAN style="COLOR: blue"&gt;AS&lt;/SPAN&gt; [SQL Text]&lt;SPAN style="COLOR: gray"&gt;,&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;sder&lt;SPAN style="COLOR: gray"&gt;.&lt;/SPAN&gt;percent_complete &lt;SPAN style="COLOR: blue"&gt;AS&lt;/SPAN&gt; [Pct Cmplt]&lt;SPAN style="COLOR: gray"&gt;,&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;sder&lt;SPAN style="COLOR: gray"&gt;.&lt;/SPAN&gt;estimated_completion_time &lt;SPAN style="COLOR: blue"&gt;AS&lt;/SPAN&gt; [Est Cmplt Time]&lt;SPAN style="COLOR: gray"&gt;,&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;sder&lt;SPAN style="COLOR: gray"&gt;.&lt;/SPAN&gt;wait_type &lt;SPAN style="COLOR: blue"&gt;AS&lt;/SPAN&gt; [Wait]&lt;SPAN style="COLOR: gray"&gt;,&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;sder&lt;SPAN style="COLOR: gray"&gt;.&lt;/SPAN&gt;wait_time &lt;SPAN style="COLOR: blue"&gt;AS&lt;/SPAN&gt; [Wait Time]&lt;SPAN style="COLOR: gray"&gt;,&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;sder&lt;SPAN style="COLOR: gray"&gt;.&lt;/SPAN&gt;last_wait_type &lt;SPAN style="COLOR: blue"&gt;AS&lt;/SPAN&gt; [Last Wait]&lt;SPAN style="COLOR: gray"&gt;,&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;sder&lt;SPAN style="COLOR: gray"&gt;.&lt;/SPAN&gt;cpu_time &lt;SPAN style="COLOR: blue"&gt;AS&lt;/SPAN&gt; [CPU Time]&lt;SPAN style="COLOR: gray"&gt;,&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;sder&lt;SPAN style="COLOR: gray"&gt;.&lt;/SPAN&gt;total_elapsed_time &lt;SPAN style="COLOR: blue"&gt;AS&lt;/SPAN&gt; [Total Elpsd Time]&lt;SPAN style="COLOR: gray"&gt;,&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;sder&lt;SPAN style="COLOR: gray"&gt;.&lt;/SPAN&gt;reads &lt;SPAN style="COLOR: blue"&gt;AS&lt;/SPAN&gt; [Reads]&lt;SPAN style="COLOR: gray"&gt;,&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;sder&lt;SPAN style="COLOR: gray"&gt;.&lt;/SPAN&gt;writes &lt;SPAN style="COLOR: blue"&gt;AS&lt;/SPAN&gt; [Writes]&lt;SPAN style="COLOR: gray"&gt;,&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;sder&lt;SPAN style="COLOR: gray"&gt;.&lt;/SPAN&gt;logical_reads &lt;SPAN style="COLOR: blue"&gt;AS&lt;/SPAN&gt; [Logical Reads]&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 9pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;FROM&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: green"&gt;sys.dm_exec_Requests&lt;/SPAN&gt; sder&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;CROSS&lt;/SPAN&gt; &lt;SPAN style="COLOR: gray"&gt;APPLY&lt;/SPAN&gt; sys.dm_exec_sql_text&lt;SPAN style="COLOR: gray"&gt;(&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;sql_handle&lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;)&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;AS&lt;/SPAN&gt; sdet&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;JOIN&lt;/SPAN&gt; &lt;SPAN style="COLOR: green"&gt;sys.dm_exec_sessions&lt;/SPAN&gt; sdes &lt;SPAN style="COLOR: blue"&gt;on&lt;/SPAN&gt; sder&lt;SPAN style="COLOR: gray"&gt;.&lt;/SPAN&gt;session_id &lt;SPAN style="COLOR: gray"&gt;=&lt;/SPAN&gt; sdes&lt;SPAN style="COLOR: gray"&gt;.&lt;/SPAN&gt;session_id&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;JOIN&lt;/SPAN&gt; &lt;SPAN style="COLOR: green"&gt;sys.databases&lt;/SPAN&gt; sd &lt;SPAN style="COLOR: blue"&gt;on&lt;/SPAN&gt; sder&lt;SPAN style="COLOR: gray"&gt;.&lt;/SPAN&gt;database_id &lt;SPAN style="COLOR: gray"&gt;=&lt;/SPAN&gt; sd&lt;SPAN style="COLOR: gray"&gt;.&lt;/SPAN&gt;database_id&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 9pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;WHERE&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 6pt 0in 3pt 47.35pt"&gt;&lt;SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 110%; FONT-FAMILY: 'Courier New'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;sder&lt;SPAN style="COLOR: gray"&gt;.&lt;/SPAN&gt;session_id &lt;SPAN style="COLOR: gray"&gt;&amp;lt;&amp;gt;&lt;/SPAN&gt; &lt;SPAN style="COLOR: fuchsia"&gt;@@SPID&lt;/SPAN&gt; &lt;SPAN style="COLOR: gray"&gt;and&lt;/SPAN&gt; sder&lt;SPAN style="COLOR: gray"&gt;.&lt;/SPAN&gt;session_id &lt;SPAN style="COLOR: gray"&gt;&amp;gt;&lt;/SPAN&gt; 50&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 110%; mso-ansi-language: EN-US; mso-bidi-font-size: 10.0pt"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;STRONG&gt;2. sys.dm_exec_query_plan (plan_handle)&lt;/STRONG&gt;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;returns the plan in XML format.&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;You can save the XML format query plan with extension&amp;nbsp; ".sqlplan" and when you open up that file it will show a nice graphical query plan.&amp;nbsp;&amp;nbsp; &lt;/STRONG&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 6pt 0in 3pt 0.5in"&gt;&lt;SPAN style="FONT-SIZE: 9pt; COLOR: blue; LINE-HEIGHT: 110%; FONT-FAMILY: 'Courier New'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;SELECT&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 110%; FONT-FAMILY: 'Courier New'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt; &lt;SPAN style="COLOR: gray"&gt;*&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;FROM&lt;/SPAN&gt; sys.dm_exec_query_plan &lt;SPAN style="COLOR: gray"&gt;(&lt;I style="mso-bidi-font-style: normal"&gt;&amp;lt;&lt;/I&gt;&lt;/SPAN&gt;&lt;I style="mso-bidi-font-style: normal"&gt;plan_handle&amp;gt;&lt;/I&gt;&lt;SPAN style="COLOR: gray"&gt;)&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;--here &amp;lt;plan_handle&amp;gt; is supplied based on the results from Query in Example 1.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 9pt; COLOR: red; LINE-HEIGHT: 110%; mso-ansi-language: EN-US; mso-bidi-font-size: 10.0pt"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;STRONG&gt;3.&lt;/STRONG&gt;&lt;STRONG&gt; sys.dm_exec_query_stats&lt;/STRONG&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P class=MsoNormal style="MARGIN: 6pt 0in 3pt 29.35pt; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo1"&gt;&lt;SPAN style="FONT-FAMILY: Symbol; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol; mso-no-proof: yes"&gt;&lt;SPAN style="mso-list: Ignore"&gt;·&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="mso-ansi-language: EN-US"&gt;The most important DMV – sys.dm_exec_query_stats - r&lt;/SPAN&gt;&lt;SPAN lang=EN-AU&gt;eturns aggregate performance statistics for cached query plans. The view contains one row per query statement within the cached plan, and the lifetime of the rows are tied to the plan itself. When a plan is removed from the cache, the corresponding rows are eliminated from this view.&lt;/SPAN&gt;&lt;SPAN style="mso-ansi-language: EN-US"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;Please &lt;/SPAN&gt;&lt;SPAN lang=EN-AU&gt;note that the statement_start_offset and statement_end_offset columns are zero based, represents number of bytes and the end offset is -1 for last statement in the batch. In addition the text value returned by sys.dm_exec_sql_text is nvarchar(max) instead of text as documented incorrectly in Books Online.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-no-proof: yes"&gt;Combined with sys_dm_exec_sql_text, it could provide rich information with all the performance related aggregates - IO (logical reads/writes, physical reads/writes), CPU (worker time), Duration (elapsed time), #of executions (execution_count).&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 9pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;SELECT&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt; &lt;SPAN style="COLOR: fuchsia"&gt;db_name&lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;(&lt;/SPAN&gt;qt&lt;SPAN style="COLOR: gray"&gt;.&lt;/SPAN&gt;dbid&lt;SPAN style="COLOR: gray"&gt;)&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;as&lt;/SPAN&gt; DatabaseName&lt;SPAN style="COLOR: gray"&gt;,&lt;/SPAN&gt; &lt;SPAN style="COLOR: fuchsia"&gt;object_name&lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;(&lt;/SPAN&gt;qt&lt;SPAN style="COLOR: gray"&gt;.&lt;/SPAN&gt;objectid&lt;SPAN style="COLOR: gray"&gt;,&lt;/SPAN&gt;qt&lt;SPAN style="COLOR: gray"&gt;.&lt;/SPAN&gt;dbid&lt;SPAN style="COLOR: gray"&gt;)&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;as&lt;/SPAN&gt; ObjectName&lt;SPAN style="COLOR: gray"&gt;,&lt;/SPAN&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;Qt&lt;SPAN style="COLOR: gray"&gt;.&lt;/SPAN&gt;text &lt;SPAN style="COLOR: blue"&gt;as&lt;/SPAN&gt; &lt;SPAN style="COLOR: red"&gt;'statement'&lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;,&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 9pt; COLOR: gray; FONT-FAMILY: 'Courier New'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 9pt; COLOR: fuchsia; FONT-FAMILY: 'Courier New'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;substring&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 9pt; COLOR: gray; FONT-FAMILY: 'Courier New'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;(&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;Qt&lt;SPAN style="COLOR: gray"&gt;.&lt;/SPAN&gt;text&lt;SPAN style="COLOR: gray"&gt;,&lt;/SPAN&gt; &lt;SPAN style="COLOR: gray"&gt;(&lt;/SPAN&gt;qs&lt;SPAN style="COLOR: gray"&gt;.&lt;/SPAN&gt;statement_start_offset&lt;SPAN style="COLOR: gray"&gt;/&lt;/SPAN&gt;2&lt;SPAN style="COLOR: gray"&gt;)+&lt;/SPAN&gt;1&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;,&lt;/SPAN&gt; &lt;SPAN style="COLOR: gray"&gt;((&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;case&lt;/SPAN&gt; qs&lt;SPAN style="COLOR: gray"&gt;.&lt;/SPAN&gt;statement_end_offset&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;when&lt;/SPAN&gt; &lt;SPAN style="COLOR: gray"&gt;-&lt;/SPAN&gt;1 &lt;SPAN style="COLOR: blue"&gt;then&lt;/SPAN&gt; &lt;SPAN style="COLOR: fuchsia"&gt;datalength&lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;(&lt;/SPAN&gt;Qt&lt;SPAN style="COLOR: gray"&gt;.&lt;/SPAN&gt;text&lt;SPAN style="COLOR: gray"&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;else&lt;/SPAN&gt; qs&lt;SPAN style="COLOR: gray"&gt;.&lt;/SPAN&gt;statement_end_offset&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;end&lt;/SPAN&gt; &lt;SPAN style="COLOR: gray"&gt;-&lt;/SPAN&gt; qs&lt;SPAN style="COLOR: gray"&gt;.&lt;/SPAN&gt;statement_start_offset&lt;SPAN style="COLOR: gray"&gt;)/&lt;/SPAN&gt;2&lt;SPAN style="COLOR: gray"&gt;)&lt;/SPAN&gt; &lt;SPAN style="COLOR: gray"&gt;+&lt;/SPAN&gt; 1&lt;SPAN style="COLOR: gray"&gt;)&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;as&lt;/SPAN&gt; &lt;SPAN style="COLOR: red"&gt;'Statement'&lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;,&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;QS&lt;SPAN style="COLOR: gray"&gt;.&lt;/SPAN&gt;Total_Logical_Reads&lt;SPAN style="COLOR: gray"&gt;,&lt;/SPAN&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;QS&lt;SPAN style="COLOR: gray"&gt;.&lt;/SPAN&gt;Total_Worker_Time&lt;SPAN style="COLOR: gray"&gt;,&lt;/SPAN&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;QS&lt;SPAN style="COLOR: gray"&gt;.&lt;/SPAN&gt;Total_Elapsed_Time&lt;SPAN style="COLOR: gray"&gt;,&lt;/SPAN&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;QS&lt;SPAN style="COLOR: gray"&gt;.&lt;/SPAN&gt;Execution_Count &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 9pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;FROM&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt; &lt;SPAN style="COLOR: green"&gt;sys.dm_exec_query_stats&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;AS&lt;/SPAN&gt; QS &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 9pt; COLOR: gray; FONT-FAMILY: 'Courier New'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;CROSS&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt; &lt;SPAN style="COLOR: gray"&gt;APPLY&lt;/SPAN&gt; sys.dm_exec_sql_text &lt;SPAN style="COLOR: gray"&gt;(&lt;/SPAN&gt;QS&lt;SPAN style="COLOR: gray"&gt;.&lt;/SPAN&gt;sql_handle&lt;SPAN style="COLOR: gray"&gt;)&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;AS&lt;/SPAN&gt; QT &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 6pt 0in 3pt 47.35pt"&gt;&lt;SPAN style="FONT-SIZE: 9pt; COLOR: blue; LINE-HEIGHT: 110%; FONT-FAMILY: 'Courier New'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;WHERE&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 110%; FONT-FAMILY: 'Courier New'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt; plan_handle &lt;SPAN style="COLOR: gray"&gt;=&lt;/SPAN&gt; &lt;SPAN style="COLOR: gray"&gt;&amp;lt;&lt;/SPAN&gt;plan_handle&lt;SPAN style="COLOR: gray"&gt;&amp;gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;-- &amp;lt;plan_handle&amp;gt; is supplied based on the results from query in example 1.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 6pt 0in 3pt 47.35pt"&gt;&lt;SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 110%; FONT-FAMILY: 'Courier New'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;&lt;SPAN style="COLOR: gray"&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P class=MsoNormal style="MARGIN: 6pt 0in 3pt 47.35pt"&gt;&lt;SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 110%; FONT-FAMILY: 'Courier New'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;&lt;SPAN style="COLOR: gray"&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;STRONG&gt;Useful resources:&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;SQL Programmability &amp;amp; API Development Team Blog - &lt;A href="http://blogs.msdn.com/sqlprogrammability/archive/2007/01.aspx" mce_href="http://blogs.msdn.com/sqlprogrammability/archive/2007/01.aspx"&gt;http://blogs.msdn.com/sqlprogrammability/archive/2007/01.aspx&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;SQL DMVStats – Performance Warehouse - &lt;A href="http://www.codeplex.com/sqldmvstats" mce_href="http://www.codeplex.com/sqldmvstats"&gt;http://www.codeplex.com/sqldmvstats&lt;/A&gt;&lt;/P&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=2039011" width="1" height="1"&gt;</content><author><name>vishah</name><uri>http://blogs.technet.com/members/vishah.aspx</uri></author></entry><entry><title>Understanding Query Plan Cache in SQL 2005 SP2 - why it's changed from SQL 2005 RTM/SP1?</title><link rel="alternate" type="text/html" href="http://blogs.technet.com/vipulshah/archive/2007/09/24/understanding-query-plan-cache-in-sql-2005-sp2-why-it-s-changed-from-sql-2005-rtm-sp1.aspx" /><id>http://blogs.technet.com/vipulshah/archive/2007/09/24/understanding-query-plan-cache-in-sql-2005-sp2-why-it-s-changed-from-sql-2005-rtm-sp1.aspx</id><published>2007-09-24T23:18:00Z</published><updated>2007-09-24T23:18:00Z</updated><content type="html">&lt;P&gt;Query execution plan gets stored in Plan Cache - the portion of the memory pool allocated for storing execution plans.&amp;nbsp;&amp;nbsp; There is a very good blog written by SQL Programmability team on why Query Plan Cache behavior changed in SQL 2005 SP2 vs. SQL 2000 and SQL 2005 RTM/SP1&amp;nbsp; - &lt;A title=http://blogs.msdn.com/sqlprogrammability/archive/2007/01/22/3-0-changes-in-caching-behavior-between-sql-server-2000-sql-server-2005-rtm-and-sql-server-2005-sp2.aspx href="http://blogs.msdn.com/sqlprogrammability/archive/2007/01/22/3-0-changes-in-caching-behavior-between-sql-server-2000-sql-server-2005-rtm-and-sql-server-2005-sp2.aspx" mce_href="http://blogs.msdn.com/sqlprogrammability/archive/2007/01/22/3-0-changes-in-caching-behavior-between-sql-server-2000-sql-server-2005-rtm-and-sql-server-2005-sp2.aspx"&gt;http://blogs.msdn.com/sqlprogrammability/archive/2007/01/22/3-0-changes-in-caching-behavior-between-sql-server-2000-sql-server-2005-rtm-and-sql-server-2005-sp2.aspx&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Based on this the plan cache size is different between SQL 2000, SQL 2005 SP1/RTM, and SQL 2005 SP2:&lt;/P&gt;
&lt;TABLE class="" cellSpacing=0 cellPadding=2 width=400 border=0&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD class="" vAlign=top width=200&gt;&lt;STRONG&gt;SQL Server Version&lt;/STRONG&gt;&lt;/TD&gt;
&lt;TD class="" vAlign=top width=200&gt;&lt;STRONG&gt;Maximum Limit on Plan Cache Size&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class="" vAlign=top width=200&gt;SQL Server 2000&lt;/TD&gt;
&lt;TD class="" vAlign=top width=200&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA"&gt;4GB upper cap on the plan cache&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class="" vAlign=top width=200&gt;SQL Server 2005 RTM/SP1&lt;/TD&gt;
&lt;TD class="" vAlign=top width=200&gt;
&lt;P&gt;75% of server memory from 0-8GB + 50% of server memory from 8Gb-64GB + 25%&amp;nbsp; of server memory &amp;gt; 64GB&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class="" vAlign=top width=200&gt;SQL Server 2005 SP2&lt;/TD&gt;
&lt;TD class="" vAlign=top width=200&gt;
&lt;P&gt;75% of server memory from 0-4GB + 10% of server memory from 4Gb-64GB + 5% of server memory &amp;gt; 64GB&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;SQL Server 2000 4GB upper cap on the plan cache 
&lt;P&gt;Example:&lt;/P&gt;
&lt;P&gt;For a SQL Server with 32Gb total SQL server memory, SQL Server 2005 RTM and SP1 cachestore limit will be 75% X 8 + 50% X (32 - 8) = 18GB&lt;/P&gt;
&lt;P&gt;SQL Server 2005 SP2 cachestore limit will be 75% X 4 + 10% X (32-4) = 5.8GB&lt;/P&gt;
&lt;P&gt;The reason for less maximum limit on Plan Cache in SQL 2005 SP2 is because Limiting the maximum size of the plan cache will ensure enough room for the database pages, and therefore improved throughput.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;A large page cache is good and normal, and increasing the size of a large page cache usually improves performance.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;A large plan cache is bad and abnormal, and increasing the size of a large plan cache rarely improves performance.&lt;/P&gt;
&lt;P&gt;There are only a fixed number of pages in a database, so increasing the size of the page cache should always improve performance.&amp;nbsp; However there is no limit to the number of different SQL statements that a poorly written application can generate.&amp;nbsp; A very large plan cache usually indicates that you’re not getting much plan reuse, and caching more plans that don’t get reused isn’t a very good strategy.&amp;nbsp; Better to cap the plan cache and use that memory for the page cache instead.&amp;nbsp;&amp;nbsp; &lt;/P&gt;
&lt;P&gt;If you find that your plan cache is anywhere near the maximum that SQL will allow, you should fix the application to get more shared SQL and plan reuse through coding changes, forced parameterization, or plan guides.&lt;/P&gt;
&lt;BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px"&gt;&lt;/BLOCKQUOTE&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=2036285" width="1" height="1"&gt;</content><author><name>vishah</name><uri>http://blogs.technet.com/members/vishah.aspx</uri></author></entry><entry><title>Maximum Capacity Specification for SQL Server 2005 and 2008</title><link rel="alternate" type="text/html" href="http://blogs.technet.com/vipulshah/archive/2007/09/14/maximum-capacity-specification-for-sql-server-2005-and-2008.aspx" /><id>http://blogs.technet.com/vipulshah/archive/2007/09/14/maximum-capacity-specification-for-sql-server-2005-and-2008.aspx</id><published>2007-09-14T23:14:23Z</published><updated>2007-09-14T23:14:23Z</updated><content type="html">&lt;p&gt;I came across this link - &lt;a title="http://technet.microsoft.com/en-us/library/ms143432(SQL.100).aspx" href="http://technet.microsoft.com/en-us/library/ms143432(SQL.100).aspx"&gt;http://technet.microsoft.com/en-us/library/ms143432(SQL.100).aspx&lt;/a&gt;.&amp;#xA0; Its amazing to see the max capacity specification for SQL Server.&amp;#xA0;&amp;#xA0;&amp;#xA0; These are for SQL Server 2008, but they haven't changed from SQL Server 2005's limit.&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; I would love to see systems with near capacity in below specifications:&lt;/p&gt;  &lt;table cellspacing="0" cellpadding="2" width="636" border="0"&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td valign="top" width="168"&gt;&lt;strong&gt;SQL Server Database Engine object &lt;/strong&gt;&lt;/td&gt;        &lt;td valign="top" width="207"&gt;&lt;strong&gt;Maximum sizes/numbers SQL Server (32-bit)&lt;/strong&gt;&lt;/td&gt;        &lt;td valign="top" width="259"&gt;&lt;strong&gt;Maximum sizes/numbers SQL Server (64-bit)&lt;/strong&gt; &lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="167"&gt;Database size&lt;/td&gt;        &lt;td valign="top" width="207"&gt;1,048,516 terabytes&lt;/td&gt;        &lt;td valign="top" width="259"&gt;1,048,516 terabytes&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="166"&gt;Databases per instance of SQL Server&lt;/td&gt;        &lt;td valign="top" width="207"&gt;32,767&lt;/td&gt;        &lt;td valign="top" width="259"&gt;32,767&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="166"&gt;Filegroups per database&lt;/td&gt;        &lt;td valign="top" width="207"&gt;32,767&lt;/td&gt;        &lt;td valign="top" width="259"&gt;32,767&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="165"&gt;Files per database&lt;/td&gt;        &lt;td valign="top" width="207"&gt;32,767&lt;/td&gt;        &lt;td valign="top" width="259"&gt;32,767&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="164"&gt;File size (data)&lt;/td&gt;        &lt;td valign="top" width="207"&gt;16 terabytes&lt;/td&gt;        &lt;td valign="top" width="259"&gt;16 terabytes&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="164"&gt;File size (log)&lt;/td&gt;        &lt;td valign="top" width="207"&gt;2 terabytes&lt;/td&gt;        &lt;td valign="top" width="259"&gt;2 terabytes&lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt; This is for SQL Server 2005 - &lt;a title="http://technet.microsoft.com/en-us/library/ms143432.aspx" href="http://technet.microsoft.com/en-us/library/ms143432.aspx"&gt;http://technet.microsoft.com/en-us/library/ms143432.aspx&lt;/a&gt;&amp;#xA0; which is similar to SQL Server 2008.&lt;/p&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=1958004" width="1" height="1"&gt;</content><author><name>vishah</name><uri>http://blogs.technet.com/members/vishah.aspx</uri></author></entry><entry><title>Useful information about Guest Account in SQL Server</title><link rel="alternate" type="text/html" href="http://blogs.technet.com/vipulshah/archive/2007/08/15/useful-information-about-guest-account-in-sql-server.aspx" /><id>http://blogs.technet.com/vipulshah/archive/2007/08/15/useful-information-about-guest-account-in-sql-server.aspx</id><published>2007-08-16T00:26:00Z</published><updated>2007-08-16T00:26:00Z</updated><content type="html">&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 8.5pt; COLOR: black; FONT-FAMILY: 'Verdana','sans-serif'"&gt;&lt;A href="http://msdn2.microsoft.com/en-us/library/ms190928.aspx"&gt;&lt;SPAN style="TEXT-DECORATION: none; text-underline: none"&gt;&lt;?xml:namespace prefix = v ns = "urn:schemas-microsoft-com:vml" /&gt;&lt;v:shapetype id=_x0000_t75 stroked="f" filled="f" path="m@4@5l@4@11@9@11@9@5xe" o:preferrelative="t" o:spt="75" coordsize="21600,21600"&gt;&lt;v:stroke joinstyle="miter"&gt;&lt;/v:stroke&gt;&lt;v:formulas&gt;&lt;v:f eqn="if lineDrawn pixelLineWidth 0"&gt;&lt;/v:f&gt;&lt;v:f eqn="sum @0 1 0"&gt;&lt;/v:f&gt;&lt;v:f eqn="sum 0 0 @1"&gt;&lt;/v:f&gt;&lt;v:f eqn="prod @2 1 2"&gt;&lt;/v:f&gt;&lt;v:f eqn="prod @3 21600 pixelWidth"&gt;&lt;/v:f&gt;&lt;v:f eqn="prod @3 21600 pixelHeight"&gt;&lt;/v:f&gt;&lt;v:f eqn="sum @0 0 1"&gt;&lt;/v:f&gt;&lt;v:f eqn="prod @6 1 2"&gt;&lt;/v:f&gt;&lt;v:f eqn="prod @7 21600 pixelWidth"&gt;&lt;/v:f&gt;&lt;v:f eqn="sum @8 21600 0"&gt;&lt;/v:f&gt;&lt;v:f eqn="prod @7 21600 pixelHeight"&gt;&lt;/v:f&gt;&lt;v:f eqn="sum @10 21600 0"&gt;&lt;/v:f&gt;&lt;/v:formulas&gt;&lt;v:path o:connecttype="rect" gradientshapeok="t" o:extrusionok="f"&gt;&lt;/v:path&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:lock aspectratio="t" v:ext="edit"&gt;&lt;/o:lock&gt;&lt;/v:shapetype&gt;&lt;v:shape id=ctl00_LibFrame_ctl01img style="WIDTH: 12pt; HEIGHT: 12pt" alt="guest user" type="#_x0000_t75" o:spid="_x0000_i1025"&gt;&lt;v:imagedata o:href="cid:image001.gif@01C7C7B5.1F1A8C30" src="file:///C:\Users\vishah\AppData\Local\Temp\msohtmlclip1\01\clip_image001.gif"&gt;&lt;/v:imagedata&gt;&lt;/v:shape&gt;&lt;/SPAN&gt;&lt;SPAN style="BACKGROUND: #3399ff; COLOR: white"&gt;guest&lt;/SPAN&gt; user&lt;/A&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 11.25pt"&gt;&lt;A class="" name=sectionToggle0&gt;&lt;/A&gt;&lt;SPAN style="FONT-SIZE: 8.5pt; COLOR: blue; FONT-FAMILY: 'Verdana','sans-serif'"&gt;When a database is created, the database includes a &lt;/SPAN&gt;&lt;SPAN style="mso-bookmark: sectionToggle0"&gt;&lt;/SPAN&gt;&lt;B&gt;&lt;SPAN style="FONT-SIZE: 8.5pt; BACKGROUND: #3399ff; COLOR: white; FONT-FAMILY: 'Verdana','sans-serif'"&gt;guest&lt;/SPAN&gt;&lt;/B&gt;&lt;SPAN style="FONT-SIZE: 8.5pt; COLOR: blue; FONT-FAMILY: 'Verdana','sans-serif'"&gt; user by default. Permissions granted to the &lt;/SPAN&gt;&lt;B&gt;&lt;SPAN style="FONT-SIZE: 8.5pt; BACKGROUND: #3399ff; COLOR: white; FONT-FAMILY: 'Verdana','sans-serif'"&gt;guest&lt;/SPAN&gt;&lt;/B&gt;&lt;SPAN style="FONT-SIZE: 8.5pt; COLOR: blue; FONT-FAMILY: 'Verdana','sans-serif'"&gt; user are inherited by users that do not have a user &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8.5pt; BACKGROUND: #3399ff; COLOR: white; FONT-FAMILY: 'Verdana','sans-serif'"&gt;account&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8.5pt; COLOR: blue; FONT-FAMILY: 'Verdana','sans-serif'"&gt; &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8.5pt; BACKGROUND: #3399ff; COLOR: white; FONT-FAMILY: 'Verdana','sans-serif'"&gt;in&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8.5pt; COLOR: blue; FONT-FAMILY: 'Verdana','sans-serif'"&gt; the database.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 11.25pt"&gt;&lt;SPAN style="FONT-SIZE: 8.5pt; COLOR: blue; FONT-FAMILY: 'Verdana','sans-serif'"&gt;The &lt;/SPAN&gt;&lt;B&gt;&lt;SPAN style="FONT-SIZE: 8.5pt; BACKGROUND: #3399ff; COLOR: white; FONT-FAMILY: 'Verdana','sans-serif'"&gt;guest&lt;/SPAN&gt;&lt;/B&gt;&lt;SPAN style="FONT-SIZE: 8.5pt; COLOR: blue; FONT-FAMILY: 'Verdana','sans-serif'"&gt; user cannot be dropped, but it can be disabled by revoking its CONNECT permission. The CONNECT permission can be revoked by executing REVOKE CONNECT FROM &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8.5pt; BACKGROUND: #3399ff; COLOR: white; FONT-FAMILY: 'Verdana','sans-serif'"&gt;GUEST&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8.5pt; COLOR: blue; FONT-FAMILY: 'Verdana','sans-serif'"&gt; within any database other than &lt;B&gt;master&lt;/B&gt; or &lt;B&gt;tempdb&lt;/B&gt;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;FONT face=Calibri size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;FONT face=Calibri size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;A href="http://msdn2.microsoft.com/en-us/library/aa905195(SQL.80).aspx"&gt;&lt;FONT face=Calibri size=3&gt;http://msdn2.microsoft.com/en-us/library/aa905195(SQL.80).aspx&lt;/FONT&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;FONT face=Calibri size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;A href="http://msdn2.microsoft.com/en-us/library/ms190928.aspx"&gt;&lt;FONT face=Calibri size=3&gt;http://msdn2.microsoft.com/en-us/library/ms190928.aspx&lt;/FONT&gt;&lt;/A&gt;&lt;/P&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=1760344" width="1" height="1"&gt;</content><author><name>vishah</name><uri>http://blogs.technet.com/members/vishah.aspx</uri></author><category term="Guest User in SQL Server" scheme="http://blogs.technet.com/vipulshah/archive/tags/Guest+User+in+SQL+Server/default.aspx" /></entry><entry><title>Connecting to Remote Integration Services Server - info with missing things on msdn article</title><link rel="alternate" type="text/html" href="http://blogs.technet.com/vipulshah/archive/2007/07/12/connecting-to-remote-integration-services-server-info-with-missing-things-on-msdn-article.aspx" /><id>http://blogs.technet.com/vipulshah/archive/2007/07/12/connecting-to-remote-integration-services-server-info-with-missing-things-on-msdn-article.aspx</id><published>2007-07-12T20:57:00Z</published><updated>2007-07-12T20:57:00Z</updated><content type="html">&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt; LINE-HEIGHT: normal; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;I found it hard way how to connect to Integration Services server remotely.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If you are part of sysadmin role on a server or if you are part of local administrators group on the server, there is no problem connecting to Integration Services server from your computer remotely.&amp;nbsp; But for others they get "Access is denied" error.&amp;nbsp;&amp;nbsp; Below are some steps to resolve this issue:&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt; LINE-HEIGHT: normal; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;Most of the steps are documented in msdn article - &lt;A href="http://msdn2.microsoft.com/en-us/library/aa337083.aspx"&gt;&lt;SPAN style="COLOR: blue; mso-bidi-font-size: 11.0pt"&gt;http://msdn2.microsoft.com/en-us/library/aa337083.aspx&lt;/SPAN&gt;&lt;/A&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt; LINE-HEIGHT: normal; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;But following is missing:&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt; LINE-HEIGHT: normal; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;One above link, under "To configure rights for remote users on Windows Server 2003"...&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;
&lt;DIV class=MsoNormal style="MARGIN: 0in 0in 10pt; LINE-HEIGHT: normal; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;replace step 9 with "Click OK to close the dialog box."&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV class=MsoNormal style="MARGIN: 0in 0in 10pt; LINE-HEIGHT: normal; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;Add a step 9.1 with the following text: "On the same Security tab, under Access Permissions, select Customize, then click Edit to open the Access Permission dialog box."&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV class=MsoNormal style="MARGIN: 0in 0in 10pt; LINE-HEIGHT: normal; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;Add a step 9.2 with the following text: "In the Access Permission dialog box, add or delete users, and assign the appropriate permissions to the appropriate users and groups. The available permissions are Local Access,&amp;nbsp;and Remote Access. The easiest is to add the local DCOM Distributed Users group.&amp;nbsp;"&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV class=MsoNormal style="MARGIN: 0in 0in 10pt; LINE-HEIGHT: normal; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;Add a step 9.3 with the following text: "Click OK to close the dialog box. Close the MMC snap-in."&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV class=MsoNormal style="MARGIN: 0in 0in 10pt; LINE-HEIGHT: normal; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;Step 10 stays as-is: "Restart the Integration Services service."&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;This should work.&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=1509386" width="1" height="1"&gt;</content><author><name>vishah</name><uri>http://blogs.technet.com/members/vishah.aspx</uri></author><category term="Integration Services" scheme="http://blogs.technet.com/vipulshah/archive/tags/Integration+Services/default.aspx" /></entry><entry><title>Connecting to multiple Data Sources using single Report</title><link rel="alternate" type="text/html" href="http://blogs.technet.com/vipulshah/archive/2007/06/26/connecting-to-multiple-data-sources-using-single-report.aspx" /><link rel="enclosure" type="image/jpeg" length="40692" href="http://blogs.technet.com/vipulshah/attachment/1370246.ashx" /><id>http://blogs.technet.com/vipulshah/archive/2007/06/26/connecting-to-multiple-data-sources-using-single-report.aspx</id><published>2007-06-26T21:31:00Z</published><updated>2007-06-26T21:31:00Z</updated><content type="html">&lt;P mce_keep="true"&gt;I have been looking for something like this for ages. This could be very useful to run a common report on a multiple servers.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;&lt;A href="http://technet.microsoft.com/en-us/library/ms156450.aspx" mce_href="http://technet.microsoft.com/en-us/library/ms156450.aspx"&gt;http://technet.microsoft.com/en-us/library/ms156450.aspx&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;B&gt;Data Source Expressions:&lt;/B&gt;&lt;BR&gt;&lt;A class="" title=sectionToggle3 name=sectionToggle3&gt;&lt;/A&gt;You can put an expression into a connection string to allow users to select the data source at run time. For example, suppose a multinational firm has data servers in several countries. With an expression-based connection string, a user who is running a sales report can select a data source for a particular country before running the report. &lt;/P&gt;
&lt;P&gt;The following example illustrates the use of a data source expression in a SQL Server connection string. The example assumes you have created a report parameter named ServerName, and DatabaseName:&lt;/P&gt;
&lt;P&gt;= "data source=" &amp;amp; Parameters!ServerName.Value &amp;amp; ";initial catalog=Parameters!DatabaseName.Value&lt;/P&gt;
&lt;P mce_keep="true"&gt;See attached picture.&lt;/P&gt;
&lt;P&gt;Data source expressions are processed at run time or when a report is previewed. The expression must be written in Visual Basic. Use the following guidelines when defining a data source expression:&lt;/P&gt;
&lt;UL type=disc&gt;
&lt;LI&gt;Design the report using a static connection string. A static connection string refers to a connection string that is not set through an expression (for example, when you follow the steps for creating a report-specific or shared data source, you are defining a static connection string). Using a static connection string allows you to connect to the data source in Report Designer so that you can get the query results you need to create the report.&lt;/LI&gt;
&lt;LI&gt;When defining the data source connection, do not use a shared data source. You cannot use a data source expression in a shared data source. You must define a report-specific data source for the report.&lt;/LI&gt;
&lt;LI&gt;Specify credentials separately from the connection string. You can use stored credentials, prompted credentials, or integrated security. &lt;/LI&gt;
&lt;LI&gt;Add a report parameter to specify a data source. For parameter values, you can either provide a static list of available values (in this case, the available values should be data sources you can use with the report) or define a query that retrieves a list of data sources at run time.&lt;/LI&gt;
&lt;LI&gt;Be sure that the list of data sources shares the same database schema. All report design begins with schema information. If there is a mismatch between the schema used to define the report and the actual schema used by the report at run time, the report might not run.&lt;/LI&gt;
&lt;LI&gt;Before publishing the report, replace the static connection string with an expression. Wait until you are finished designing the report before you replace the static connection string with an expression. Once you use an expression, you cannot execute the query in Report Designer. Furthermore, the field list in the Datasets window and the Parameters list will not update automatically.&lt;/LI&gt;&lt;/UL&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=1370246" width="1" height="1"&gt;</content><author><name>vishah</name><uri>http://blogs.technet.com/members/vishah.aspx</uri></author><category term="Reporting Services" scheme="http://blogs.technet.com/vipulshah/archive/tags/Reporting+Services/default.aspx" /></entry><entry><title>/3GB /PAE and AWE on 32-bit Systems</title><link rel="alternate" type="text/html" href="http://blogs.technet.com/vipulshah/archive/2007/05/10/3gb-pae-and-awe-on-32-bit-systems.aspx" /><id>http://blogs.technet.com/vipulshah/archive/2007/05/10/3gb-pae-and-awe-on-32-bit-systems.aspx</id><published>2007-05-10T19:11:00Z</published><updated>2007-05-10T19:11:00Z</updated><content type="html">&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'"&gt;I was reading a blog post from Chad Boyd - &lt;A href="http://blogs.msdn.com/chadboyd/archive/2007/03/24/pae-and-3gb-and-awe-oh-my.aspx"&gt;http://blogs.msdn.com/chadboyd/archive/2007/03/24/pae-and-3gb-and-awe-oh-my.aspx&lt;/A&gt;.&amp;nbsp;&amp;nbsp; He has very detailed and excellent information about /3GB PAE and AWE.&amp;nbsp;&amp;nbsp;&amp;nbsp; It made my understanding more clear.&amp;nbsp;&amp;nbsp;&amp;nbsp; Here is the summarized version:&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;H1 style="MARGIN: 24pt 0in 0pt"&gt;&lt;SPAN style="LINE-HEIGHT: 115%; mso-bidi-font-size: 10.0pt"&gt;&lt;FONT size=5&gt;&lt;FONT face=Cambria&gt;For 32-bit OS&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/H1&gt;
&lt;H2 style="MARGIN: 10pt 0in 0pt"&gt;&lt;FONT face=Cambria size=4&gt;Memory Addressability Limitation:&lt;/FONT&gt;&lt;/H2&gt;
&lt;P style="MARGIN-TOP: 0in"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'"&gt;By default, the 32bit OS can only 'see' and use up to 4gb of memory, as it uses a 32bit range to map physical memory space (with a valid range of 0x00000000 up to 0xFFFFFFFF, or 0 thru 4,294,967,295 in decimal format, which correlates to a maximum high range pointer of 4GB.&amp;nbsp;&amp;nbsp;Yes, this means that on a default 32bit system no matter how much physical memory you install on the system, the system would only ever use at most 4 GB of it (kind of a waste if you have a 32bit server with 64GB of memory)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;H2 style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face=Cambria size=4&gt;Virtual Address Space (VAS) Limitation:&lt;/FONT&gt;&lt;/H2&gt;
&lt;P style="MARGIN-TOP: 0in"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'"&gt;When a process is created on a 32-bit Windows System, OS allocates Virtual Address Space (VAS) to that process.&amp;nbsp;&amp;nbsp; All user-mode process (such as SQL Server) has its own VAS.&amp;nbsp; Each process in 32-bit system has 4 GB of VAS.&amp;nbsp; VAS is further divided into two equal sections: 1st&amp;nbsp;section which is available to the&amp;nbsp;process and 2nd section&amp;nbsp;which is reserved for kernel/system.&amp;nbsp; So, out of 4 GB VAS, 2 GB is available to the process and 2 GB is reserved for kernel/system.&amp;nbsp; So, though a VAS is 4GB in size, a user-mode process by default only has access to up to 2GB of that space - yes,&amp;nbsp;this means that by default, a 32bit user-mode process can only ever access 2GB of memory at the most using standard API's.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;H2 style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face=Cambria size=4&gt;/3GB can address the&amp;nbsp;VAS limitations:&amp;nbsp; &lt;/FONT&gt;&lt;/H2&gt;
&lt;P style="MARGIN-TOP: 0in"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'"&gt;With /3GB you can change the VAS allocation from&amp;nbsp;2 GB for process to 3 GB availability for the process and reserving only 1 GB for kernel/system.&amp;nbsp;&amp;nbsp; Limitation of /3GB is that it can only be used for&amp;nbsp;the system&amp;nbsp;having memory upto 16 GB.&amp;nbsp;&amp;nbsp; This is because&amp;nbsp;the limited 1GB of kernel space - that is&amp;nbsp;very limited space&amp;nbsp;to be able to store internal memory mapping structures.&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;H2 style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face=Cambria size=4&gt;/PAE can address the memory addressability limitation of 32-bit system:&lt;/FONT&gt;&lt;/H2&gt;
&lt;P style="MARGIN-TOP: 0in"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'"&gt;With /PAE you can change the addressability of 32-bit system from 2^32 to 2^36 (from 4 GB to 64 GB).&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;H2 style="MARGIN: 10pt 0in 0pt"&gt;&lt;FONT face=Cambria size=4&gt;AWE:&lt;/FONT&gt;&lt;/H2&gt;
&lt;P style="MARGIN-TOP: 0in"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'"&gt;AWE can take the advantage of increased addressability by PAE.&amp;nbsp;&amp;nbsp; With AWE you can increase memory availability to SQL Server from 4 GB (for 32-bit) to up to 64 GB.&amp;nbsp;&amp;nbsp; So, although AWE allows you to access/use memory outside&amp;nbsp;the processes' VAS, the process is still confined by the VAS in terms of being able to read/write data into memory&amp;nbsp;mapped by AWE mechanisms.&amp;nbsp; Only Data Cache can utilize AWE, no other memory consumer within SQL such as Hash cache, Sorting, plan cache, connection cache, etc. can use memory available through AWE.&amp;nbsp;&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;H2 style="MARGIN: 10pt 0in 0pt"&gt;&lt;FONT face=Cambria size=4&gt;Simple Formula:&lt;/FONT&gt;&lt;/H2&gt;
&lt;P style="MARGIN-TOP: 0in"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'"&gt;If your system has &amp;lt; 4 GB - use only /3GB&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN-TOP: 0in"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'"&gt;If your system has &amp;gt; 4 GB and &amp;lt; 16 GB - use /3GB + /PAE + AWE&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN-TOP: 0in"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'"&gt;If your system&amp;nbsp;has &amp;gt; 16 GB - use /PAE + AWE&lt;/SPAN&gt;&lt;/P&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=924724" width="1" height="1"&gt;</content><author><name>vishah</name><uri>http://blogs.technet.com/members/vishah.aspx</uri></author><category term="/3GB /PAE and AWE" scheme="http://blogs.technet.com/vipulshah/archive/tags/_2F00_3GB+_2F00_PAE+and+AWE/default.aspx" /></entry><entry><title>Data Scripter Utility for SSMS</title><link rel="alternate" type="text/html" href="http://blogs.technet.com/vipulshah/archive/2007/05/04/data-scripter-utility-for-ssms.aspx" /><id>http://blogs.technet.com/vipulshah/archive/2007/05/04/data-scripter-utility-for-ssms.aspx</id><published>2007-05-04T20:15:00Z</published><updated>2007-05-04T20:15:00Z</updated><content type="html">&lt;P&gt;You can generate a script for a data within a table - whole bunch of insert statement.&amp;nbsp;&amp;nbsp; There is an external plug-in available at &lt;A href="http://www.codeproject.com/useritems/enisey.asp"&gt;http://www.codeproject.com/useritems/enisey.asp&lt;/A&gt;.&amp;nbsp;&amp;nbsp; I downloaded it and installed it on my machine, it works great.&amp;nbsp;&amp;nbsp;&amp;nbsp;After installing it you will see an option in your SSMS within Right-click menu off of a selected table to Script out data within the table.&amp;nbsp;&amp;nbsp;&amp;nbsp; Here is the introduction of this utility from this site:&lt;/P&gt;
&lt;P&gt;"Enisey" is data scripter add-in to Microsoft SQL Server Management Studio (SSMS). One expands the functionality of SSMS and allows to script data from any tables into a choosen ".sql" file in the view of INSERT statements. It is one .NET 2.0 assembly, registered as COM-object and registered as SSMS addin. The sources contain also setup project for building the full-fledged setup file. Because the project is a plugin, the full built distributive is shipped instead of demo-project. It is prepared for the use. Just install it and you can see a new context menu item "Script Data" inside SSMS on each table. &lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=882474" width="1" height="1"&gt;</content><author><name>vishah</name><uri>http://blogs.technet.com/members/vishah.aspx</uri></author><category term="Data Scripter Utility" scheme="http://blogs.technet.com/vipulshah/archive/tags/Data+Scripter+Utility/default.aspx" /></entry></feed>