<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Journey to SQL Authority with Pinal Dave &#187; SQL Security</title>
	<atom:link href="http://blog.sqlauthority.com/category/sql-security/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.sqlauthority.com</link>
	<description>Notes of a SQL Server MVP and Database Administrator</description>
	<lastBuildDate>Sat, 21 Nov 2009 01:30:19 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='blog.sqlauthority.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/08e35387c05b61340e885b1763a69d9f?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>Journey to SQL Authority with Pinal Dave &#187; SQL Security</title>
		<link>http://blog.sqlauthority.com</link>
	</image>
			<item>
		<title>SQLAuthority News &#8211; Database Encryption in SQL Server 2008 Enterprise Edition</title>
		<link>http://blog.sqlauthority.com/2009/10/03/sqlauthority-news-database-encryption-in-sql-server-2008-enterprise-edition/</link>
		<comments>http://blog.sqlauthority.com/2009/10/03/sqlauthority-news-database-encryption-in-sql-server-2008-enterprise-edition/#comments</comments>
		<pubDate>Sat, 03 Oct 2009 01:30:36 +0000</pubDate>
		<dc:creator>pinaldave</dc:creator>
				<category><![CDATA[SQL]]></category>
		<category><![CDATA[SQL Authority]]></category>
		<category><![CDATA[SQL Query]]></category>
		<category><![CDATA[SQL Security]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SQL Tips and Tricks]]></category>
		<category><![CDATA[SQL White Papers]]></category>
		<category><![CDATA[SQLAuthority News]]></category>
		<category><![CDATA[T SQL]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[SQL Server Encryption]]></category>

		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=6973</guid>
		<description><![CDATA[With the introduction of transparent data encryption (TDE) in SQL Server 2008, users now have the choice between cell-level encryption as in SQL Server 2005, full database-level encryption by using TDE, or the file-level encryption options provided by Windows. TDE is the optimal choice for bulk encryption to meet regulatory compliance or corporate data security standards. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&blog=668536&post=6973&subd=sqlauthority&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p style="text-align:justify;">With the introduction of transparent data encryption (TDE) in SQL Server 2008, users now have the choice between cell-level encryption as in SQL Server 2005, full database-level encryption by using TDE, or the file-level encryption options provided by Windows. TDE is the optimal choice for bulk encryption to meet regulatory compliance or corporate data security standards. TDE works at the file level, which is similar to two Windows® features: the Encrypting File System (EFS) and BitLocker™ Drive Encryption, the new volume-level encryption introduced in Windows Vista®, both of which also encrypt data on the hard drive.</p>
<p style="text-align:justify;">TDE does not replace cell-level encryption, EFS, or BitLocker. This white paper compares TDE with these other encryption methods for application developers and database administrators. While this is not a technical, in-depth review of TDE, technical implementations are explored and a familiarity with concepts such as virtual log files and the buffer pool are assumed. The user is assumed to be familiar with cell-level encryption and cryptography in general. Implementing database encryption is covered, but not the rationale for encrypting a database.</p>
<p><a href="http://www.pinaldave.com/bimg/encryption.gif"><img class="alignnone" src="http://www.pinaldave.com/bimg/encryption.gif" alt="" width="498" height="681" /></a></p>
<p><strong><a href="http://msdn.microsoft.com/en-us/library/cc278098.aspx" target="_blank">Read Database Encryption in SQL Server 2008 Enterprise Edition</a></strong></p>
<p>Reference: <strong>Pinal Dave (</strong><a href="http://blog.sqlauthority.com/" target="_blank"><strong>http://blog.sqlauthority.com</strong></a><strong>)</strong></p>
Posted in SQL, SQL Authority, SQL Query, SQL Security, SQL Server, SQL Tips and Tricks, SQL White Papers, SQLAuthority News, T SQL, Technology Tagged: SQL Server Encryption <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sqlauthority.wordpress.com/6973/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sqlauthority.wordpress.com/6973/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sqlauthority.wordpress.com/6973/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sqlauthority.wordpress.com/6973/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sqlauthority.wordpress.com/6973/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sqlauthority.wordpress.com/6973/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sqlauthority.wordpress.com/6973/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sqlauthority.wordpress.com/6973/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sqlauthority.wordpress.com/6973/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sqlauthority.wordpress.com/6973/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&blog=668536&post=6973&subd=sqlauthority&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://blog.sqlauthority.com/2009/10/03/sqlauthority-news-database-encryption-in-sql-server-2008-enterprise-edition/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/48aa5a2264e8a27d802bb22ab6ccf688?s=96&#38;d=identicon" medium="image">
			<media:title type="html">pinaldave</media:title>
		</media:content>

		<media:content url="http://www.pinaldave.com/bimg/encryption.gif" medium="image" />
	</item>
		<item>
		<title>SQL SERVER &#8211; Cryptography in SQL Server 2008</title>
		<link>http://blog.sqlauthority.com/2009/09/15/sql-server-cryptography-in-sql-server-2008/</link>
		<comments>http://blog.sqlauthority.com/2009/09/15/sql-server-cryptography-in-sql-server-2008/#comments</comments>
		<pubDate>Tue, 15 Sep 2009 01:30:35 +0000</pubDate>
		<dc:creator>pinaldave</dc:creator>
				<category><![CDATA[Pinal Dave]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[SQL Authority]]></category>
		<category><![CDATA[SQL Query]]></category>
		<category><![CDATA[SQL Security]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SQL Tips and Tricks]]></category>
		<category><![CDATA[T SQL]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=6807</guid>
		<description><![CDATA[SQL Server, particularly the 2005 and 2008 versions, offers the functionality of cryptography. In the following, this functionality is briefly explained.
Introduction
Any database professional will support the encryption of data. However, the encryption of data has to be carried out at the database engine level. This is quite tricky as there the database performance can be [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&blog=668536&post=6807&subd=sqlauthority&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p style="text-align:justify;">SQL Server, particularly the 2005 and 2008 versions, offers the functionality of cryptography. In the following, this functionality is briefly explained.</p>
<p style="text-align:justify;"><strong>Introduction</strong></p>
<p style="text-align:justify;">Any database professional will support the encryption of data. However, the encryption of data has to be carried out at the database engine level. This is quite tricky as there the database performance can be affected by the process of decryption, data manipulation, and then re-encryption when data is being updated. SQL Server offers robust data security. Further, it is important to have strong knowledge of cryptography in SQL Server in order to avoid many problems that are encountered by DBAs while implementing cryptography.</p>
<p style="text-align:justify;"><strong>SQL Server Authentication</strong></p>
<p style="text-align:justify;">When users log in to the database, there are two major steps of identifying the user: <em>authentication</em> and <em>authorization</em> (permissions).</p>
<ul style="text-align:justify;">
<li>Authentication implies the verification of user’s identity or the <em>security principal</em>. Encryption and signature play an important role in the authentication process.</li>
<li>Authorizations (also known as permissions) are the rights granted to a particular user. Permissions to a signature in SQL Server.</li>
</ul>
<p style="text-align:justify;"><strong>Protection of SQL Server Data by Encryption</strong></p>
<p style="text-align:justify;">At times, one can adequately protect data by controlling access to a table by using SQL Server robust permissions architecture. Therefore, what is the necessity of encrypting data on the server.</p>
<p style="text-align:justify;">In general, if the storage medium such as SAN and backup tapes is completely secure, it is not necessary to encrypt data. If an attacker can break the permissions architecture, then he/she can possibly access the encryption keys of your database with very little effort. In such case, encryption cannot help.</p>
<p style="text-align:justify;">However, if an attacker wants to access the file system, encryption defends the system to a greater depth.</p>
<p style="text-align:justify;">Encryption is necessary for the data that fall in the following categories:</p>
<ul style="text-align:justify;">
<li>For vulnerable storage media, wherein there are chances of loosing the backup data from PC or tapes.</li>
<li>In some cases, the data has to be protected from sysadmins. In such an instance, it is advisable to use the middle tier to perform encryption and decryption, rather than SQL server internal encryption. However, if the keys are stored in the SQL Server, it is almost impossible to protect the data from a sysadmin who is determined to find the keys.</li>
<li>If a sets of records (rows) within the same table needs to be protected, then users with cryptographic keys can be allowed to access the specific records, but not the other records within the same table. Encryption makes this process of hiding rows easy. In the case of regulating the permissions to columns, permissions on views can be enforced.</li>
<li>Highly sensitive data requires encryption for storage. Such data include information on credit cards and military projects.</li>
</ul>
<p style="text-align:justify;">Third-party backup options that enable the encryption of backup files can be considered in situations wherein offsite tape storage is less secure and the disk storage access is secure.</p>
<p style="text-align:justify;"><strong>Conclusion</strong></p>
<p style="text-align:justify;">The cryptographic functionality of SQL Sever has to deal with problems that were not taken into consideration during its design. Some common examples are as follows:</p>
<ul style="text-align:justify;">
<li>The use of asymmetric key pairs in cases where key communication is not a crucial issue; for example, when data is stored in the SQL Server database.</li>
<li>SQL Server permissions are sufficient to control access to data, except in situations where the access to the storage media is compromised. In such case, the security via encryption stands unnecessary.</li>
</ul>
<p style="text-align:justify;">Importantly, by using the cryptographic functionality of SQL Server, it is easy to create robust security. The native functionality offers access control and key storage, and the built-in encryption functionality offers robust security (including random salt and authenticator values). The ease in implementation of this functionality makes it an attractive choice for all types of users.</p>
<p style="text-align:justify;"><strong>Reference: </strong><strong>Pinal Dave (</strong><a href="http://blog.sqlauthority.com/" target="_blank"><strong>http://blog.sqlauthority.com</strong></a><strong>), </strong>White paper by <a href="http://msdn.microsoft.com/en-us/library/cc837966.aspx" target="_blank">John Hicks</a>, Microsoft Industry Solutions Group</p>
Posted in Pinal Dave, SQL, SQL Authority, SQL Query, SQL Security, SQL Server, SQL Tips and Tricks, T SQL, Technology  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sqlauthority.wordpress.com/6807/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sqlauthority.wordpress.com/6807/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sqlauthority.wordpress.com/6807/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sqlauthority.wordpress.com/6807/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sqlauthority.wordpress.com/6807/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sqlauthority.wordpress.com/6807/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sqlauthority.wordpress.com/6807/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sqlauthority.wordpress.com/6807/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sqlauthority.wordpress.com/6807/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sqlauthority.wordpress.com/6807/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&blog=668536&post=6807&subd=sqlauthority&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://blog.sqlauthority.com/2009/09/15/sql-server-cryptography-in-sql-server-2008/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/48aa5a2264e8a27d802bb22ab6ccf688?s=96&#38;d=identicon" medium="image">
			<media:title type="html">pinaldave</media:title>
		</media:content>
	</item>
		<item>
		<title>SQL SERVER &#8211; FIX : ERROR : Cannot open database requested by the login. The login failed. Login failed for user &#8216;NT AUTHORITY\NETWORK SERVICE&#8217;.</title>
		<link>http://blog.sqlauthority.com/2009/08/20/sql-server-fix-error-cannot-open-database-requested-by-the-login-the-login-failed-login-failed-for-user-nt-authoritynetwork-service/</link>
		<comments>http://blog.sqlauthority.com/2009/08/20/sql-server-fix-error-cannot-open-database-requested-by-the-login-the-login-failed-login-failed-for-user-nt-authoritynetwork-service/#comments</comments>
		<pubDate>Thu, 20 Aug 2009 01:30:47 +0000</pubDate>
		<dc:creator>pinaldave</dc:creator>
				<category><![CDATA[Pinal Dave]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[SQL Authority]]></category>
		<category><![CDATA[SQL Error Messages]]></category>
		<category><![CDATA[SQL Query]]></category>
		<category><![CDATA[SQL Scripts]]></category>
		<category><![CDATA[SQL Security]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SQL Tips and Tricks]]></category>
		<category><![CDATA[T SQL]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[SQL Login]]></category>

		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=6622</guid>
		<description><![CDATA[This error is quite common and I have received it few times while I was working on a recent consultation project.
Cannot open database requested by the login. The login failed.
Login failed for user &#8216;NT AUTHORITY\NETWORK SERVICE&#8217;.

This error occurs when you have configured your application with IIS, and IIS goes to SQL Server and tries to [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&blog=668536&post=6622&subd=sqlauthority&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p style="text-align:justify;">This error is quite common and I have received it few times while I was working on a recent consultation project.</p>
<p style="text-align:justify;"><em><span style="color:#ff0000;">Cannot open database requested by the login. The login failed.<br />
Login failed for user &#8216;NT AUTHORITY\NETWORK SERVICE&#8217;.</span></em>
</p>
<p style="text-align:justify;">This error occurs when you have configured your application with IIS, and IIS goes to SQL Server and tries to login with credentials that do not have proper permissions. This error can also occur when replication or mirroring is set up.</p>
<p style="text-align:justify;">If you search online, there are many different solutions provided to solve this error, and many of these solutions work fine. However, I will be going over a solution that works always and is very simple.</p>
<p style="text-align:justify;"><strong>Fix/Workaround/Solution:</strong></p>
<p style="text-align:justify;">Go to SQL Server &gt;&gt; Security &gt;&gt; Logins and right click on NT AUTHORITY\NETWORK SERVICE and select Properties</p>
<p style="text-align:justify;"><img class="alignnone" src="http://www.pinaldave.com/bimg/errnt.jpg" alt="" width="468" height="439" /></p>
<p style="text-align:justify;">In newly opened screen of Login Properties, go to the “User Mapping” tab. Then, on the “User Mapping” tab, select the desired database – especially the database for which this error message is displayed. On the lower screen, check the role db_owner. Click OK.</p>
<p style="text-align:justify;"><img class="alignnone" src="http://www.pinaldave.com/bimg/errnt1.jpg" alt="" width="500" height="451" /></p>
<p style="text-align:justify;">In almost all such cases, this should fix your problem.</p>
<p style="text-align:justify;">Reference : <strong>Pinal Dave (</strong><a href="http://blog.sqlauthority.com/" target="_blank"><strong>http://blog.sqlauthority.com</strong></a><strong>)</strong></p>
Posted in Pinal Dave, SQL, SQL Authority, SQL Error Messages, SQL Query, SQL Scripts, SQL Security, SQL Server, SQL Tips and Tricks, T SQL, Technology Tagged: SQL Login <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sqlauthority.wordpress.com/6622/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sqlauthority.wordpress.com/6622/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sqlauthority.wordpress.com/6622/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sqlauthority.wordpress.com/6622/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sqlauthority.wordpress.com/6622/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sqlauthority.wordpress.com/6622/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sqlauthority.wordpress.com/6622/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sqlauthority.wordpress.com/6622/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sqlauthority.wordpress.com/6622/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sqlauthority.wordpress.com/6622/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&blog=668536&post=6622&subd=sqlauthority&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://blog.sqlauthority.com/2009/08/20/sql-server-fix-error-cannot-open-database-requested-by-the-login-the-login-failed-login-failed-for-user-nt-authoritynetwork-service/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/48aa5a2264e8a27d802bb22ab6ccf688?s=96&#38;d=identicon" medium="image">
			<media:title type="html">pinaldave</media:title>
		</media:content>

		<media:content url="http://www.pinaldave.com/bimg/errnt.jpg" medium="image" />

		<media:content url="http://www.pinaldave.com/bimg/errnt1.jpg" medium="image" />
	</item>
		<item>
		<title>SQL SERVER &#8211; Reason for SQL Server Agent Starting Before SQL Server Engine Service</title>
		<link>http://blog.sqlauthority.com/2009/08/13/sql-server-reason-for-sql-server-agent-starting-before-sql-server-engine-service/</link>
		<comments>http://blog.sqlauthority.com/2009/08/13/sql-server-reason-for-sql-server-agent-starting-before-sql-server-engine-service/#comments</comments>
		<pubDate>Thu, 13 Aug 2009 01:30:57 +0000</pubDate>
		<dc:creator>pinaldave</dc:creator>
				<category><![CDATA[Database]]></category>
		<category><![CDATA[Pinal Dave]]></category>
		<category><![CDATA[Readers Question]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[SQL Authority]]></category>
		<category><![CDATA[SQL Query]]></category>
		<category><![CDATA[SQL Security]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SQL Tips and Tricks]]></category>
		<category><![CDATA[T SQL]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[SQL Server Agent]]></category>

		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=6590</guid>
		<description><![CDATA[Nakul, a dedicated member of the Gandhinagar SQL Server User Group, recently emailed me with a very interesting, but quick question. He asked me why the SQL Server Agent starts before SQL Server Engine does? He made the very valid point that as the SQL Server Engine is the core service, it should start first, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&blog=668536&post=6590&subd=sqlauthority&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p style="text-align:justify;">Nakul, a dedicated member of the Gandhinagar SQL Server User Group, recently emailed me with a very interesting, but quick question. He asked me <em><strong>why the SQL Server Agent starts before SQL Server Engine does?</strong></em> He made the very valid point that as the SQL Server Engine is the core service, it should start first, and there is little point to running the SQL Server Agent without it.</p>
<p style="text-align:justify;">Off the top of my head, I can offer the following quick reasons for this sequence:</p>
<ul style="text-align:justify;">
<li>The SQL Server Engine does not only run jobs for SQL Server Engine itself. It also runs jobs for other core services like the SQL Server Analysis Service, Integration Service, Reporting Service etc.;</li>
<li>The SQL Server Agent can run almost any kind of task that an Operating system can run. For example invoking any program or running shell scripts;</li>
</ul>
<ul style="text-align:justify;">
<li>The SQL Server Agent also      starts jobs which are scheduled to run the second the SQL Server Engine      starts, and for this reason it is needed; and</li>
<li>Replication, mirroring and a few      other tasks also depend on Agent Jobs.</li>
</ul>
<p style="text-align:justify;">These are the reasons that I have come up with so far. Can you think of any more? Let us have your views.</p>
<p style="text-align:justify;">Reference : <strong>Pinal Dave (</strong><a href="http://blog.sqlauthority.com/" target="_blank"><strong>http://blog.SQLAuthority.com</strong></a><strong>)</strong></p>
Posted in Database, Pinal Dave, Readers Question, SQL, SQL Authority, SQL Query, SQL Security, SQL Server, SQL Tips and Tricks, T SQL, Technology Tagged: SQL Server Agent <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sqlauthority.wordpress.com/6590/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sqlauthority.wordpress.com/6590/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sqlauthority.wordpress.com/6590/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sqlauthority.wordpress.com/6590/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sqlauthority.wordpress.com/6590/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sqlauthority.wordpress.com/6590/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sqlauthority.wordpress.com/6590/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sqlauthority.wordpress.com/6590/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sqlauthority.wordpress.com/6590/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sqlauthority.wordpress.com/6590/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&blog=668536&post=6590&subd=sqlauthority&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://blog.sqlauthority.com/2009/08/13/sql-server-reason-for-sql-server-agent-starting-before-sql-server-engine-service/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/48aa5a2264e8a27d802bb22ab6ccf688?s=96&#38;d=identicon" medium="image">
			<media:title type="html">pinaldave</media:title>
		</media:content>
	</item>
		<item>
		<title>SQL SERVER &#8211; Forgot the Password of Username SA</title>
		<link>http://blog.sqlauthority.com/2009/08/04/sql-server-forgot-the-password-of-username-sa/</link>
		<comments>http://blog.sqlauthority.com/2009/08/04/sql-server-forgot-the-password-of-username-sa/#comments</comments>
		<pubDate>Tue, 04 Aug 2009 01:30:24 +0000</pubDate>
		<dc:creator>pinaldave</dc:creator>
				<category><![CDATA[Pinal Dave]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[SQL Authority]]></category>
		<category><![CDATA[SQL Query]]></category>
		<category><![CDATA[SQL Scripts]]></category>
		<category><![CDATA[SQL Security]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SQL Server Management Studio]]></category>
		<category><![CDATA[SQL Tips and Tricks]]></category>
		<category><![CDATA[T SQL]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Password]]></category>
		<category><![CDATA[Username]]></category>

		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=6268</guid>
		<description><![CDATA[I just received a call from an old friend with whom I used to work in Las Vegas. He told me about a password-related issue he faced in his organization. They had changed the password of username SA and now they are not able to recall the new password. I am sure that he is [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&blog=668536&post=6268&subd=sqlauthority&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p style="text-align:justify;">I just received a call from an old friend with whom I used to work in Las Vegas. He told me about a password-related issue he faced in his organization. They had changed the password of username SA and now they are not able to recall the new password. I am sure that he is not the first person who has faced this issue. There may be many more similar situations where employees who have sysamin password leaves the job or a hacker disables the SA account.</p>
<p style="text-align:justify;">Resetting the password of SA is a breeze!</p>
<p style="text-align:justify;"><strong>Option 1 :</strong></p>
<p style="text-align:justify;">If there is any other SQL Server Login that is a member of sysadmin role, you can log in using that account and reset the password of SQL Server. Change the password of SA account as described here :  <a href="http://blog.sqlauthority.com/2007/12/29/sql-server-change-password-of-sa-login-using-management-studio/" target="_blank">SQL SERVER – Change Password of SA Login Using Management Studio</a>.</p>
<p style="text-align:justify;"><strong>Option 2 :</strong></p>
<p style="text-align:justify;">If there is any other Windows Login that is a member of Windows Admin Group, log in using that account. Start SQL Server in Single User Mode as described here :  <a href="http://blog.sqlauthority.com/2009/02/10/sql-server-start-sql-server-instance-in-single-user-mode/" target="_blank">SQL SERVER – Start SQL Server Instance in Single User Mode</a>.<br />
Create a new login and give it sysadmin permission.
</p>
<p style="text-align:justify;">Note : If you have SQL Server Agent enabled, it starts before SQL Server service. If you have enabled SQL Server in a single user mode, it will connect it first, so it is recommended to turn that off before attempting any of the above options.</p>
<p style="text-align:justify;">Reference : <strong>Pinal Dave (</strong><a href="http://blog.sqlauthority.com/" target="_blank"><strong>http://blog.SQLAuthority.com</strong></a><strong>)</strong></p>
Posted in Pinal Dave, SQL, SQL Authority, SQL Query, SQL Scripts, SQL Security, SQL Server, SQL Server Management Studio, SQL Tips and Tricks, T SQL, Technology Tagged: Password, Username <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sqlauthority.wordpress.com/6268/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sqlauthority.wordpress.com/6268/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sqlauthority.wordpress.com/6268/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sqlauthority.wordpress.com/6268/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sqlauthority.wordpress.com/6268/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sqlauthority.wordpress.com/6268/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sqlauthority.wordpress.com/6268/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sqlauthority.wordpress.com/6268/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sqlauthority.wordpress.com/6268/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sqlauthority.wordpress.com/6268/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&blog=668536&post=6268&subd=sqlauthority&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://blog.sqlauthority.com/2009/08/04/sql-server-forgot-the-password-of-username-sa/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/48aa5a2264e8a27d802bb22ab6ccf688?s=96&#38;d=identicon" medium="image">
			<media:title type="html">pinaldave</media:title>
		</media:content>
	</item>
		<item>
		<title>SQL SERVER &#8211; 2008 &#8211; Policy-Based Management &#8211; Create, Evaluate and Fix Policies</title>
		<link>http://blog.sqlauthority.com/2009/06/30/sql-server-2008-policy-based-management-create-evaluate-and-fix-policies/</link>
		<comments>http://blog.sqlauthority.com/2009/06/30/sql-server-2008-policy-based-management-create-evaluate-and-fix-policies/#comments</comments>
		<pubDate>Tue, 30 Jun 2009 01:30:44 +0000</pubDate>
		<dc:creator>pinaldave</dc:creator>
				<category><![CDATA[Pinal Dave]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[SQL Authority]]></category>
		<category><![CDATA[SQL Query]]></category>
		<category><![CDATA[SQL Scripts]]></category>
		<category><![CDATA[SQL Security]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SQL Tips and Tricks]]></category>
		<category><![CDATA[T SQL]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Policy Management]]></category>

		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=5771</guid>
		<description><![CDATA[This article will cover the most spectacular feature of SQL 2008 &#8211; Policy-based management and how the configuration of SQL Server with policy-based management architecture can make a powerful difference. Policy based management is loaded with several advantages. It can help you implement various policies for reliable configuration of the system. It also provides additional [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&blog=668536&post=5771&subd=sqlauthority&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p style="text-align:justify;">This article will cover the most spectacular feature of SQL 2008 &#8211; Policy-based management and how the configuration of SQL Server with policy-based management architecture can make a powerful difference. Policy based management is loaded with several advantages. It can help you implement various policies for reliable configuration of the system. It also provides additional administration assistance to DBAs and helps them effortlessly manage various tasks of SQL Server across the enterprise.</p>
<p style="text-align:justify;">1 Introduction<br />
2 Basics of Policy Management<br />
3 Policy Management Terms<br />
4 Practical Example of Policy Management<br />
4.1 Exploring of Facets<br />
4.2 Create a Condition<br />
4.3 Create a Policy<br />
4.4 Evaluate a Policy<br />
4.5 Fix Non-complying Policy<br />
5 Summary</p>
<h3 style="text-align:justify;"><a href="http://dotnetslackers.com/articles/sql/Policy-Based-Management-Create-Evaluate-and-Fix-Policies.aspx" target="_blank">Read complete article here.</a></h3>
</p>
<p style="text-align:justify;">Reference : <strong>Pinal Dave (<a href="http://blog.sqlauthority.com/" target="_blank">http://blog.SQLAuthority.com</a>)</strong></p>
Posted in Pinal Dave, SQL, SQL Authority, SQL Query, SQL Scripts, SQL Security, SQL Server, SQL Tips and Tricks, T SQL, Technology Tagged: Policy Management <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sqlauthority.wordpress.com/5771/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sqlauthority.wordpress.com/5771/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sqlauthority.wordpress.com/5771/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sqlauthority.wordpress.com/5771/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sqlauthority.wordpress.com/5771/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sqlauthority.wordpress.com/5771/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sqlauthority.wordpress.com/5771/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sqlauthority.wordpress.com/5771/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sqlauthority.wordpress.com/5771/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sqlauthority.wordpress.com/5771/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&blog=668536&post=5771&subd=sqlauthority&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://blog.sqlauthority.com/2009/06/30/sql-server-2008-policy-based-management-create-evaluate-and-fix-policies/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/48aa5a2264e8a27d802bb22ab6ccf688?s=96&#38;d=identicon" medium="image">
			<media:title type="html">pinaldave</media:title>
		</media:content>
	</item>
		<item>
		<title>SQLAuthority News &#8211; Using SQL Server 2008 Extended Events &#8211; White paper By Jonathan Kehayias</title>
		<link>http://blog.sqlauthority.com/2009/06/07/sqlauthority-news-using-sql-server-2008-extended-events-white-paper-by-jonathan-kehayias/</link>
		<comments>http://blog.sqlauthority.com/2009/06/07/sqlauthority-news-using-sql-server-2008-extended-events-white-paper-by-jonathan-kehayias/#comments</comments>
		<pubDate>Sun, 07 Jun 2009 01:30:23 +0000</pubDate>
		<dc:creator>pinaldave</dc:creator>
				<category><![CDATA[SQL]]></category>
		<category><![CDATA[SQL Authority]]></category>
		<category><![CDATA[SQL Documentation]]></category>
		<category><![CDATA[SQL Query]]></category>
		<category><![CDATA[SQL Security]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SQL Tips and Tricks]]></category>
		<category><![CDATA[SQL White Papers]]></category>
		<category><![CDATA[T SQL]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=5379</guid>
		<description><![CDATA[Strange it may sound but being a SQL Server pro has its downside too. Common information on SQL does not interest me, while a good document is hard to find. So the reader in me is mostly discontented and constantly keeps looking for interesting documents.  Recently, I chanced upon a really good white paper by [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&blog=668536&post=5379&subd=sqlauthority&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p style="text-align:justify;">Strange it may sound but being a SQL Server pro has its downside too. Common information on SQL does not interest me, while a good document is hard to find. So the reader in me is mostly discontented and constantly keeps looking for interesting documents.  Recently, I chanced upon a really good white paper by <strong>Jonathan Keyhayias</strong> on SQL Serve r2008 extended events. I have known Jonathan through forums but have not met him in person yet. But I hope to meet him soon.</p>
<p style="text-align:justify;">The white paper starts with introduction to the extended event and then elaborates on its architecture, system objects, confusing target data and other important aspects of the extended events. This white paper ends with life of an event, and I would recommend that you read this portion at least if you do not have sufficient time to read the whole white paper.</p>
<p style="text-align:justify;">Let us go through the first paragraph taken from the white paper which lucidly defines extended events.</p>
<p style="text-align:justify;"><strong>What is extended events?</strong><br />
As SQL Server matures with time, the diagnostics tools available to administrators to troubleshoot problems when they arise have also matured. SQL Server 2000 had very limited diagnostic tools when compared with SQL Server 2005. SQL Trace and SQL Server Profiler were often the tools of choice for administrators to identify problems with performance, along with DBCC and individual trace flags like 1205 for deadlocks, and 3605 to log results to the SQL Server error log. With SQL Server 2005, the diagnostic tools expanded to include the dynamic management views, which provide a deep view into the internal workings of SQL Server, additional trace events for SQL Trace and SQL Server Profiler including the deadlock graph and Showplan XML events, the ability to import performance counter logs in SQL Server Profiler to view trace events along with their impact on the system, and WMI events which use Service Broker endpoints for event notifications. SQL Server 2008 continues to build upon the diagnostic tools with a new feature called Extended Events.
</p>
<p style="text-align:justify;">You can continue reading the white paper <strong><a href="http://msdn.microsoft.com/en-us/library/dd822788.aspx" target="_blank">Using SQL Server 2008 Extended Events</a></strong> here.</p>
<p style="text-align:justify;">Let me have your views about this white paper.</p>
<p style="text-align:justify;">Reference : <strong>Pinal Dave (<a href="http://blog.sqlauthority.com/" target="_blank">http://blog.SQLAuthority.com</a>)</strong></p>
Posted in SQL, SQL Authority, SQL Documentation, SQL Query, SQL Security, SQL Server, SQL Tips and Tricks, SQL White Papers, T SQL, Technology  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sqlauthority.wordpress.com/5379/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sqlauthority.wordpress.com/5379/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sqlauthority.wordpress.com/5379/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sqlauthority.wordpress.com/5379/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sqlauthority.wordpress.com/5379/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sqlauthority.wordpress.com/5379/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sqlauthority.wordpress.com/5379/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sqlauthority.wordpress.com/5379/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sqlauthority.wordpress.com/5379/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sqlauthority.wordpress.com/5379/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&blog=668536&post=5379&subd=sqlauthority&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://blog.sqlauthority.com/2009/06/07/sqlauthority-news-using-sql-server-2008-extended-events-white-paper-by-jonathan-kehayias/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/48aa5a2264e8a27d802bb22ab6ccf688?s=96&#38;d=identicon" medium="image">
			<media:title type="html">pinaldave</media:title>
		</media:content>
	</item>
		<item>
		<title>SQL SERVER &#8211; Find Hostname and Current Logged In User Name</title>
		<link>http://blog.sqlauthority.com/2009/05/26/sql-server-find-hostname-and-current-logged-in-user-name/</link>
		<comments>http://blog.sqlauthority.com/2009/05/26/sql-server-find-hostname-and-current-logged-in-user-name/#comments</comments>
		<pubDate>Tue, 26 May 2009 01:30:12 +0000</pubDate>
		<dc:creator>pinaldave</dc:creator>
				<category><![CDATA[Pinal Dave]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[SQL Authority]]></category>
		<category><![CDATA[SQL Function]]></category>
		<category><![CDATA[SQL Query]]></category>
		<category><![CDATA[SQL Scripts]]></category>
		<category><![CDATA[SQL Security]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SQL Tips and Tricks]]></category>
		<category><![CDATA[T SQL]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Username]]></category>

		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=5166</guid>
		<description><![CDATA[I work in an environment wherein I connect to multiple servers across the world. Time and again, my SSMS is connected to a myriad of servers that kindles a lot of confusion. I frequently use the following trick to separate different connections, which I mentioned in my blog sometime back SQL SERVER – 2008 – [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&blog=668536&post=5166&subd=sqlauthority&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p style="text-align:justify;">I work in an environment wherein I connect to multiple servers across the world. Time and again, my SSMS is connected to a myriad of servers that kindles a lot of confusion. I frequently use the following trick to separate different connections, which I mentioned in my blog sometime back <strong><a href="http://blog.sqlauthority.com/2009/01/04/sql-server-2008-change-color-of-status-bar-of-ssms-query-editor/">SQL SERVER – 2008 – Change Color of Status Bar of SSMS Query Editor</a></strong>. However, this trick does not help when a huge number of different connections are open. In such a case, I use the following handy script. Do not go by the length of the script; it might be very short but always works great!</p>
<p style="text-align:justify;">Now, let’s take a look at the execution of this script in two different scenarios.</p>
<p style="text-align:justify;"><strong>1) Logged in using SQL Authentication</strong></p>
<p style="text-align:justify;"><code style="font-size:12px;"><span style="color:blue;">SELECT </span><span style="color:magenta;">HOST_NAME</span><span style="color:gray;">() </span><span style="color:blue;">AS </span><span style="color:black;">HostName</span><span style="color:gray;">, </span><span style="color:black;">SUSER_NAME</span><span style="color:gray;">() </span><span style="color:black;">LoggedInUser</span></code></p>
<p style="text-align:justify;"><img class="alignnone" src="http://www.pinaldave.com/bimg/loginsa.jpg" alt="" width="431" height="154" /></p>
<p style="text-align:justify;">
<p style="text-align:justify;"><strong>2) Logged in using Windows Authentication</strong></p>
<p style="text-align:justify;"><code style="font-size:12px;"><span style="color:blue;">SELECT </span><span style="color:magenta;">HOST_NAME</span><span style="color:gray;">() </span><span style="color:blue;">AS </span><span style="color:black;">HostName</span><span style="color:gray;">, </span><span style="color:black;">SUSER_NAME</span><span style="color:gray;">() </span><span style="color:black;">LoggedInUser</span></code></p>
<p style="text-align:justify;"><img class="alignnone" src="http://www.pinaldave.com/bimg/loginwin.jpg" alt="" width="338" height="149" /></p>
<p style="text-align:justify;">
<p style="text-align:justify;">It is quite evident from both the above cases that we get correct logged-in username and hostname. Let me know if this script is helpful to you when you face a similar situation.</p>
<p style="text-align:justify;">Reference : <strong>Pinal Dave (<a href="http://blog.sqlauthority.com/" target="_blank">http://blog.SQLAuthority.com</a>)</strong></p>
Posted in Pinal Dave, SQL, SQL Authority, SQL Function, SQL Query, SQL Scripts, SQL Security, SQL Server, SQL Tips and Tricks, T SQL, Technology Tagged: Username <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sqlauthority.wordpress.com/5166/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sqlauthority.wordpress.com/5166/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sqlauthority.wordpress.com/5166/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sqlauthority.wordpress.com/5166/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sqlauthority.wordpress.com/5166/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sqlauthority.wordpress.com/5166/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sqlauthority.wordpress.com/5166/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sqlauthority.wordpress.com/5166/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sqlauthority.wordpress.com/5166/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sqlauthority.wordpress.com/5166/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&blog=668536&post=5166&subd=sqlauthority&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://blog.sqlauthority.com/2009/05/26/sql-server-find-hostname-and-current-logged-in-user-name/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/48aa5a2264e8a27d802bb22ab6ccf688?s=96&#38;d=identicon" medium="image">
			<media:title type="html">pinaldave</media:title>
		</media:content>

		<media:content url="http://www.pinaldave.com/bimg/loginsa.jpg" medium="image" />

		<media:content url="http://www.pinaldave.com/bimg/loginwin.jpg" medium="image" />
	</item>
		<item>
		<title>SQL SERVER &#8211; FIX : ERROR :  is not a valid Win32 application. (Exception from HRESULT: 0&#215;800700C1)</title>
		<link>http://blog.sqlauthority.com/2009/04/30/sql-server-fix-error-is-not-a-valid-win32-application-exception-from-hresult-0x800700c1/</link>
		<comments>http://blog.sqlauthority.com/2009/04/30/sql-server-fix-error-is-not-a-valid-win32-application-exception-from-hresult-0x800700c1/#comments</comments>
		<pubDate>Thu, 30 Apr 2009 01:30:51 +0000</pubDate>
		<dc:creator>pinaldave</dc:creator>
				<category><![CDATA[Pinal Dave]]></category>
		<category><![CDATA[Readers Question]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[SQL Authority]]></category>
		<category><![CDATA[SQL Error Messages]]></category>
		<category><![CDATA[SQL Query]]></category>
		<category><![CDATA[SQL Security]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SQL Tips and Tricks]]></category>
		<category><![CDATA[T SQL]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=4760</guid>
		<description><![CDATA[Just a day ago, one of my friend sent me email requesting help with following error:
is not a valid Win32 application. (Exception from HRESULT: 0&#215;800700C1)
In fact this is not SQL Server error but it is of .NET application. The solution of this error is just changing configuration of IIS7.
Fix/Solution/Workaround:
Go to IIS.
Click on Application Pool.
Look for [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&blog=668536&post=4760&subd=sqlauthority&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p style="text-align:justify;">Just a day ago, one of my friend sent me email requesting help with following error:</p>
<p style="text-align:justify;"><span style="color:#ff0000;">is not a valid Win32 application. (Exception from HRESULT: 0&#215;800700C1)</span></p>
<p style="text-align:justify;">In fact this is not SQL Server error but it is of .NET application. The solution of this error is just changing configuration of IIS7.</p>
<p style="text-align:justify;"><strong>Fix/Solution/Workaround:</strong></p>
<p style="text-align:justify;">Go to IIS.<br />
Click on Application Pool.<br />
Look for your web application in application pool.<br />
Go to Advanced Settings by right clicking on previously selected application pool.<br />
Enable 32-Bit Applications by checking it.
</p>
<p style="text-align:justify;">Reference : <strong>Pinal Dave (<a href="http://blog.sqlauthority.com/" target="_blank">http://blog.SQLAuthority.com</a>)</strong></p>
Posted in Pinal Dave, Readers Question, SQL, SQL Authority, SQL Error Messages, SQL Query, SQL Security, SQL Server, SQL Tips and Tricks, T SQL, Technology  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sqlauthority.wordpress.com/4760/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sqlauthority.wordpress.com/4760/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sqlauthority.wordpress.com/4760/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sqlauthority.wordpress.com/4760/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sqlauthority.wordpress.com/4760/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sqlauthority.wordpress.com/4760/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sqlauthority.wordpress.com/4760/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sqlauthority.wordpress.com/4760/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sqlauthority.wordpress.com/4760/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sqlauthority.wordpress.com/4760/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&blog=668536&post=4760&subd=sqlauthority&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://blog.sqlauthority.com/2009/04/30/sql-server-fix-error-is-not-a-valid-win32-application-exception-from-hresult-0x800700c1/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/48aa5a2264e8a27d802bb22ab6ccf688?s=96&#38;d=identicon" medium="image">
			<media:title type="html">pinaldave</media:title>
		</media:content>
	</item>
		<item>
		<title>SQL SERVER &#8211; Introduction to SQL Server Encryption and Symmetric Key Encryption Tutorial with Script</title>
		<link>http://blog.sqlauthority.com/2009/04/28/sql-server-introduction-to-sql-server-encryption-and-symmetric-key-encryption-tutorial-with-script/</link>
		<comments>http://blog.sqlauthority.com/2009/04/28/sql-server-introduction-to-sql-server-encryption-and-symmetric-key-encryption-tutorial-with-script/#comments</comments>
		<pubDate>Tue, 28 Apr 2009 01:30:57 +0000</pubDate>
		<dc:creator>pinaldave</dc:creator>
				<category><![CDATA[Pinal Dave]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[SQL Authority]]></category>
		<category><![CDATA[SQL Query]]></category>
		<category><![CDATA[SQL Scripts]]></category>
		<category><![CDATA[SQL Security]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SQL Tips and Tricks]]></category>
		<category><![CDATA[T SQL]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[SQL Server Encryption]]></category>

		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=4481</guid>
		<description><![CDATA[SQL Server 2005 and SQL Server 2008 provide encryption as a new feature to protect data against hackers’ attacks. Hackers might be able to penetrate the database or tables, but owing to encryption they would not be able to understand the data or make use of it. Nowadays, it has become imperative to encrypt crucial [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&blog=668536&post=4481&subd=sqlauthority&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p style="text-align:justify;">SQL Server 2005 and SQL Server 2008 provide encryption as a new feature to protect data against hackers’ attacks. Hackers might be able to penetrate the database or tables, but owing to encryption they would not be able to understand the data or make use of it. Nowadays, it has become imperative to encrypt crucial security-related data while storing in the database as well as during transmission across a network between the client and the server.</p>
<p style="text-align:justify;">Encryption hierarchy is marked by three-level security. These three levels provide different mechanisms for securing data across networks and local servers. Different levels of hierarchies allow multiple instances of services (e.g., SQL Server Services) to run on one physical server.</p>
<ul style="text-align:justify;">
<li><strong>Windows Level</strong> &#8211; Highest Level &#8211; Uses Windows DP API for encryption</li>
<li><strong>SQL Server Level </strong>- Moderate Level &#8211; Uses Services Master Key for encryption</li>
<li><strong>Database Level</strong> &#8211; Lower Level &#8211; Uses Database Master Key for encryption</li>
</ul>
<p style="text-align:justify;">There are two  kinds of keys used in encryption:</p>
<ul style="text-align:justify;">
<li><strong>Symmetric Key</strong> &#8211; In Symmetric cryptography system, the sender and the receiver of a message share a single, common key that is used to encrypt and decrypt the message. This is relatively easy to implement, and both the sender and the receiver can encrypt or decrypt the messages.</li>
<li> <strong>Asymmetric Key</strong> &#8211; Asymmetric cryptography, also known as Public-key cryptography, is a system in which the sender and the receiver of a message have a pair of cryptographic keys &#8211; a public key and a private key &#8211; to encrypt and decrypt the message. This is a relatively complex system where the sender can use his key to encrypt the message but he cannot decrypt it. The receiver, on the other hand, can use his key to decrypt the message but he cannot encrypt it. This intricacy has turned it into a resource-intensive process.</li>
</ul>
<p style="text-align:justify;">Yet another way to encrypt data is through certificates. A public key certificate is a digitally signed statement that binds the value of a public key to the identity of the person, device, or service that holds the corresponding private key. A Certification Authority (CA) issues and signs certifications. <strong><a href="http://www.pinaldave.com/best-sql-server-download.cfm?download=EncryptDecrypt" target="_blank">Download complete script here</a></strong>.</p>
<p style="text-align:justify;">Please create a sample database that we will be use for testing Encryption. There are two different kinds of encryptions available in SQL Server:</p>
<ul style="text-align:justify;">
<li><strong>Database Level</strong> &#8211; This level secures all the data in a database. However, every time data is written or read from database, the whole database needs to be decrypted. This is a very resource-intensive process and not a practical solution.</li>
<li><strong>Column (or Row) Level</strong> &#8211; This level of encryption is the most preferred method. Here, only columns containing important data should be encrypted; this will result in lower CPU load compared with the whole database level encryption. If a column is used as a primary key or used in comparison clauses (WHERE clauses, JOIN conditions) the database will have to decrypt the whole column to perform operations involving those columns.</li>
</ul>
<p style="text-align:justify;">Let&#8217;s go over a simple instance that demonstrates the encryption and the decryption process executed with Symmetric Key and Triple DES encryption algorithm.<br />
<code style="font-size:12px;"><span style="color:green;"><br />
/* Create Database  */<br />
</span><span style="color:blue;">USE </span><span style="color:black;">master<br />
GO<br />
</span><span style="color:blue;">CREATE DATABASE </span><span style="color:black;">EncryptTest<br />
</span><span style="color:blue;">ON PRIMARY </span><span style="color:gray;">( </span><span style="color:black;">NAME </span><span style="color:blue;">= </span><span style="color:red;">N'EncryptTest'</span><span style="color:gray;">, </span><span style="color:black;">FILENAME </span><span style="color:blue;">= </span><span style="color:red;">N'C:EncryptTest.mdf'</span><span style="color:gray;">)<br />
</span><span style="color:magenta;">LOG </span><span style="color:blue;">ON </span><span style="color:gray;">( </span><span style="color:black;">NAME </span><span style="color:blue;">= </span><span style="color:red;">N'EncryptTest_log'</span><span style="color:gray;">, </span><span style="color:black;">FILENAME </span><span style="color:blue;">= </span><span style="color:red;">N'C:EncryptTest_log.ldf'</span><span style="color:gray;">)<br />
</span><span style="color:black;">GO</span></code></p>
<p style="text-align:justify;">First, let&#8217;s create a sample table and then populate it with sample data. We will now encrypt one of the two columns of the table.<br />
<code style="font-size:12px;"><span style="color:green;"><br />
/* Create table and insert data in the table */<br />
</span><span style="color:blue;">USE </span><span style="color:black;">EncryptTest<br />
GO<br />
</span><span style="color:blue;">CREATE TABLE </span><span style="color:black;">TestTable </span><span style="color:gray;">(</span><span style="color:black;">FirstCol </span><span style="color:blue;">INT</span><span style="color:gray;">, </span><span style="color:black;">SecondCol </span><span style="color:blue;">VARCHAR</span><span style="color:gray;">(</span><span style="color:black;">50</span><span style="color:gray;">))<br />
</span><span style="color:black;">GO<br />
</span><span style="color:blue;">INSERT INTO </span><span style="color:black;">TestTable </span><span style="color:gray;">(</span><span style="color:black;">FirstCol</span><span style="color:gray;">, </span><span style="color:black;">SecondCol</span><span style="color:gray;">)<br />
</span><span style="color:blue;">SELECT </span><span style="color:black;">1</span><span style="color:gray;">,</span><span style="color:red;">'First'<br />
</span><span style="color:blue;">UNION </span><span style="color:gray;">ALL<br />
</span><span style="color:blue;">SELECT </span><span style="color:black;">2</span><span style="color:gray;">,</span><span style="color:red;">'Second'<br />
</span><span style="color:blue;">UNION </span><span style="color:gray;">ALL<br />
</span><span style="color:blue;">SELECT </span><span style="color:black;">3</span><span style="color:gray;">,</span><span style="color:red;">'Third'<br />
</span><span style="color:blue;">UNION </span><span style="color:gray;">ALL<br />
</span><span style="color:blue;">SELECT </span><span style="color:black;">4</span><span style="color:gray;">,</span><span style="color:red;">'Fourth'<br />
</span><span style="color:blue;">UNION </span><span style="color:gray;">ALL<br />
</span><span style="color:blue;">SELECT </span><span style="color:black;">5</span><span style="color:gray;">,</span><span style="color:red;">'Fifth'<br />
</span><span style="color:black;">GO<br />
</span><span style="color:green;">/* Check the content of the TestTable */<br />
</span><span style="color:blue;">USE </span><span style="color:black;">EncryptTest<br />
GO<br />
</span><span style="color:blue;">SELECT </span><span style="color:gray;">*<br />
</span><span style="color:blue;">FROM </span><span style="color:black;">TestTable<br />
GO</span></code>
</p>
<p style="text-align:justify;">The preceding code will return the result depicted in the subsequent figure.</p>
<div class="mceTemp" style="text-align:justify;">
<dl class="wp-caption alignnone">
<dt class="wp-caption-dt"><img title="Result of the SQL query" src="http://www.pinaldave.com/bimg/SqlQueryResult1.gif" alt="" width="156" height="121" /></dt>
<dd class="wp-caption-dd">Result of the SQL query</dd>
</dl>
</div>
<p style="text-align:justify;">Every database can have one master key. Database master key is a symmetric key used to protect the private keys of certificates and asymmetric keys present in the database. It uses Triple DES algorithm together with user-provided password to encrypt the keys.<br />
<code style="font-size:12px;"><span style="color:green;"><br />
/* Create Database Master Key */<br />
</span><span style="color:blue;">USE </span><span style="color:black;">EncryptTest<br />
GO<br />
</span><span style="color:blue;">CREATE </span><span style="color:black;">MASTER </span><span style="color:blue;">KEY </span><span style="color:black;">ENCRYPTION<br />
</span><span style="color:blue;">BY </span><span style="color:black;">PASSWORD </span><span style="color:blue;">= </span><span style="color:red;">'SQLAuthority'<br />
</span><span style="color:black;">GO</span></code></p>
<p style="text-align:justify;">Certificates are used to safeguard encryption keys, which are used to encrypt data in the database. SQL Server 2005 has the capability to generate self-signed X.509 certificates.<br />
<code style="font-size:12px;"><span style="color:green;"><br />
/* Create Encryption Certificate */<br />
</span><span style="color:blue;">USE </span><span style="color:black;">EncryptTest<br />
GO<br />
</span><span style="color:blue;">CREATE </span><span style="color:black;">CERTIFICATE EncryptTestCert<br />
</span><span style="color:blue;">WITH </span><span style="color:black;">SUBJECT </span><span style="color:blue;">= </span><span style="color:red;">'SQLAuthority'<br />
</span><span style="color:black;">GO</span></code></p>
<p style="text-align:justify;">The symmetric key can be encrypted by using various options such as certificate, password, symmetric key, and asymmetric key. A number of different algorithms can be employed for encrypting key. The supported algorithms are DES, TRIPLE_DES, RC2, RC4, RC4_128, DESX, AES_128, AES_192, and AES_256.<br />
<code style="font-size:12px;"><span style="color:green;"><br />
/* Create Symmetric Key */<br />
</span><span style="color:blue;">USE </span><span style="color:black;">EncryptTest<br />
GO<br />
</span><span style="color:blue;">CREATE </span><span style="color:black;">SYMMETRIC </span><span style="color:blue;">KEY </span><span style="color:black;">TestTableKey<br />
</span><span style="color:blue;">WITH </span><span style="color:black;">ALGORITHM </span><span style="color:blue;">= </span><span style="color:black;">TRIPLE_DES ENCRYPTION<br />
</span><span style="color:blue;">BY </span><span style="color:black;">CERTIFICATE EncryptTestCert<br />
GO</span></code></p>
<p style="text-align:justify;">Now add a column of type varbinary to the original table, which will store the encrypted value for the SecondCol.<br />
<code style="font-size:12px;"><span style="color:green;"><br />
/*  Encrypt Data using Key and Certificate<br />
Add Columns which will hold the encrypted data in binary */<br />
</span><span style="color:blue;">USE </span><span style="color:black;">EncryptTest<br />
GO<br />
</span><span style="color:blue;">ALTER TABLE </span><span style="color:black;">TestTable<br />
</span><span style="color:blue;">ADD </span><span style="color:black;">EncryptSecondCol VARBINARY</span><span style="color:gray;">(</span><span style="color:black;">256</span><span style="color:gray;">)<br />
</span><span style="color:black;">GO</span></code></p>
<p style="text-align:justify;">Before the key is used, it needs to be decrypted using the same method that was used for encrypting it. In our example, we have used a certificate for encrypting the key. Because of the same reason, we are using the same certificate for opening the key and making it available for use. Subsequent to opening it and making it available for use, we can use the encryptkey function and store the encrypted values in the database, in the EncryptSecondCol column.<br />
<code style="font-size:12px;"><span style="color:green;"><br />
/* Update binary column with encrypted data created by certificate and key */<br />
</span><span style="color:blue;">USE </span><span style="color:black;">EncryptTest<br />
GO<br />
</span><span style="color:blue;">OPEN </span><span style="color:black;">SYMMETRIC </span><span style="color:blue;">KEY </span><span style="color:black;">TestTableKey DECRYPTION<br />
</span><span style="color:blue;">BY </span><span style="color:black;">CERTIFICATE EncryptTestCert<br />
</span><span style="color:blue;">UPDATE </span><span style="color:black;">TestTable<br />
</span><span style="color:blue;">SET </span><span style="color:black;">EncryptSecondCol </span><span style="color:blue;">= </span><span style="color:black;">ENCRYPTBYKEY</span><span style="color:gray;">(</span><span style="color:black;">KEY_GUID</span><span style="color:gray;">(</span><span style="color:red;">'TestTableKey'</span><span style="color:gray;">),</span><span style="color:black;">SecondCol</span><span style="color:gray;">)<br />
</span><span style="color:black;">GO</span></code></p>
<p style="text-align:justify;">We can drop the original SecondCol column, which we have now encrypted in the EncryptSecondCol column. If you do not want to drop the column, you can keep it for future comparison of the data when we decrypt the column.<br />
<code style="font-size:12px;"><span style="color:green;"><br />
/* DROP original column which was encrypted for protect the data */<br />
</span><span style="color:blue;">USE </span><span style="color:black;">EncryptTest<br />
GO<br />
</span><span style="color:blue;">ALTER TABLE </span><span style="color:black;">TestTable<br />
</span><span style="color:blue;">DROP COLUMN </span><span style="color:black;">SecondCol<br />
GO</span></code>
</p>
<p style="text-align:justify;">We can run a SELECT query on our database and verify if our data in the table is well protected and hackers will not be able to make use of it even if they somehow manage to reach the data.</p>
<p style="text-align:justify;"><code style="font-size:12px;"><span style="color:green;">/* Check the content of the TestTable */<br />
</span><span style="color:blue;">USE </span><span style="color:black;">EncryptTest<br />
GO<br />
</span><span style="color:blue;">SELECT </span><span style="color:gray;">*<br />
</span><span style="color:blue;">FROM </span><span style="color:black;">TestTable<br />
GO</span></code></p>
<div class="mceTemp" style="text-align:justify;">
<dl class="wp-caption alignnone">
<dt class="wp-caption-dt"><img title="Result of the previous SQL query" src="http://www.pinaldave.com/bimg/SqlQueryResult2.gif" alt="" width="417" height="118" /></dt>
<dd class="wp-caption-dd">Result of the previous SQL query</dd>
</dl>
</div>
<p style="text-align:justify;">Authorized user can use the decryptbykey function to retrieve the original data from the encrypted column. If Symmetric key is not open for decryption, it has to be decrypted using the same certificate that was used to encrypt it. An important point to bear in mind here is that the original column and the decrypted column should have the same data types. If their data types differ, incorrect values could be reproduced. In our case, we have used a VARCHAR data type for SecondCol and EncryptSecondCol.</p>
<p style="text-align:justify;"><code style="font-size:12px;"><span style="color:green;">/* Decrypt the data of the SecondCol  */<br />
</span><span style="color:blue;">USE </span><span style="color:black;">EncryptTest<br />
GO<br />
</span><span style="color:blue;">OPEN </span><span style="color:black;">SYMMETRIC </span><span style="color:blue;">KEY </span><span style="color:black;">TestTableKey DECRYPTION<br />
</span><span style="color:blue;">BY </span><span style="color:black;">CERTIFICATE EncryptTestCert<br />
</span><span style="color:blue;">SELECT </span><span style="color:magenta;">CONVERT</span><span style="color:gray;">(</span><span style="color:blue;">VARCHAR</span><span style="color:gray;">(</span><span style="color:black;">50</span><span style="color:gray;">),</span><span style="color:black;">DECRYPTBYKEY</span><span style="color:gray;">(</span><span style="color:black;">EncryptSecondCol</span><span style="color:gray;">)) </span><span style="color:blue;">AS </span><span style="color:black;">DecryptSecondCol<br />
</span><span style="color:blue;">FROM </span><span style="color:black;">TestTable<br />
GO</span></code></p>
<div class="mceTemp" style="text-align:justify;">
<dl class="wp-caption alignnone">
<dt class="wp-caption-dt"><img title="Result of the previous SQL query" src="http://www.pinaldave.com/bimg/SqlQueryResult3.gif" alt="" width="192" height="122" /></dt>
<dd class="wp-caption-dd">Result of the previous SQL query</dd>
</dl>
</div>
<p style="text-align:justify;">If you drop the database after the entire processing is complete, you do not have to worry about cleaning up the database. However, in real world on production servers, the database is not dropped. It is a good practice for developers to close the key after using it. If keys and certificates are used only once or their use is over, they can be dropped as well. Dropping a database will drop everything it contains &#8211; table, keys, certificates, all the data, to name a few.</p>
<p style="text-align:justify;"><code style="font-size:12px;"><span style="color:green;">/* Clean up database  */<br />
</span><span style="color:blue;">USE </span><span style="color:black;">EncryptTest<br />
GO<br />
</span><span style="color:blue;">CLOSE </span><span style="color:black;">SYMMETRIC </span><span style="color:blue;">KEY </span><span style="color:black;">TestTableKey<br />
GO<br />
</span><span style="color:blue;">DROP </span><span style="color:black;">SYMMETRIC </span><span style="color:blue;">KEY </span><span style="color:black;">TestTableKey<br />
GO<br />
</span><span style="color:blue;">DROP </span><span style="color:black;">CERTIFICATE EncryptTestCert<br />
GO<br />
</span><span style="color:blue;">DROP </span><span style="color:black;">MASTER </span><span style="color:blue;">KEY<br />
</span><span style="color:black;">GO<br />
</span><span style="color:blue;">USE </span><span style="color:black;">[master]<br />
GO<br />
</span><span style="color:blue;">DROP DATABASE </span><span style="color:black;">[EncryptTest]<br />
GO</span></code>
</p>
<p style="text-align:justify;"><strong>Summary</strong></p>
<p style="text-align:justify;">Encryption is a very important security feature of SQL Server 2005. Long keys and asymmetric keys create unassailable, stronger encryption and stronger encryption uses lots of CPU to encrypt data. Stronger encryption is slower to process. When there is a huge amount of data to encrypt, it is suggested to encrypt it using a symmetric key. The same symmetric key can be encrypted further with an asymmetric key for additional protection, thereby adding the advantage of a stronger encryption. It is also recommended to compress data before encryption, as encrypted data cannot be compressed.</p>
<p style="text-align:justify;">Reference : <strong>Pinal Dave (<a href="http://blog.sqlauthority.com/" target="_blank">http://blog.SQLAuthority.com</a>),</strong><a href="http://dotnetslackers.com/articles/sql/IntroductionToSQLServerEncryptionAndSymmetricKeyEncryptionTutorial.aspx" target="_blank"> DotNetSlackers</a>,<strong><a href="http://www.pinaldave.com/best-sql-server-download.cfm?download=EncryptDecrypt" target="_blank">Download complete script here</a></strong></p>
Posted in Pinal Dave, SQL, SQL Authority, SQL Query, SQL Scripts, SQL Security, SQL Server, SQL Tips and Tricks, T SQL, Technology Tagged: SQL Server Encryption <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sqlauthority.wordpress.com/4481/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sqlauthority.wordpress.com/4481/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sqlauthority.wordpress.com/4481/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sqlauthority.wordpress.com/4481/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sqlauthority.wordpress.com/4481/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sqlauthority.wordpress.com/4481/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sqlauthority.wordpress.com/4481/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sqlauthority.wordpress.com/4481/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sqlauthority.wordpress.com/4481/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sqlauthority.wordpress.com/4481/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&blog=668536&post=4481&subd=sqlauthority&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://blog.sqlauthority.com/2009/04/28/sql-server-introduction-to-sql-server-encryption-and-symmetric-key-encryption-tutorial-with-script/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/48aa5a2264e8a27d802bb22ab6ccf688?s=96&#38;d=identicon" medium="image">
			<media:title type="html">pinaldave</media:title>
		</media:content>

		<media:content url="http://www.pinaldave.com/bimg/SqlQueryResult1.gif" medium="image">
			<media:title type="html">Result of the SQL query</media:title>
		</media:content>

		<media:content url="http://www.pinaldave.com/bimg/SqlQueryResult2.gif" medium="image">
			<media:title type="html">Result of the previous SQL query</media:title>
		</media:content>

		<media:content url="http://www.pinaldave.com/bimg/SqlQueryResult3.gif" medium="image">
			<media:title type="html">Result of the previous SQL query</media:title>
		</media:content>
	</item>
		<item>
		<title>SQL SERVER &#8211; FIX : Error: 18486 Login failed for user &#8217;sa&#8217; because the account is currently locked out. The system administrator can unlock it. &#8211; Unlock SA Login</title>
		<link>http://blog.sqlauthority.com/2009/04/23/sql-server-fix-error-18486-login-failed-for-user-sa-because-the-account-is-currently-locked-out-the-system-administrator-can-unlock-it-unlock-sa-login/</link>
		<comments>http://blog.sqlauthority.com/2009/04/23/sql-server-fix-error-18486-login-failed-for-user-sa-because-the-account-is-currently-locked-out-the-system-administrator-can-unlock-it-unlock-sa-login/#comments</comments>
		<pubDate>Thu, 23 Apr 2009 01:30:22 +0000</pubDate>
		<dc:creator>pinaldave</dc:creator>
				<category><![CDATA[Pinal Dave]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[SQL Authority]]></category>
		<category><![CDATA[SQL Error Messages]]></category>
		<category><![CDATA[SQL Query]]></category>
		<category><![CDATA[SQL Scripts]]></category>
		<category><![CDATA[SQL Security]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SQL Tips and Tricks]]></category>
		<category><![CDATA[SQLServer]]></category>
		<category><![CDATA[T SQL]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[hacking]]></category>

		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=4488</guid>
		<description><![CDATA[Today, we will riffle through a very simple, yet common issue &#8211; How to unlock a locked &#8220;sa&#8221; login?
It is quite a common practice that SQL Server is hosted on a separate server than application server. In most cases, SQL Server ports or IP are exposed to the web, which makes them risk prone. For [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&blog=668536&post=4488&subd=sqlauthority&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p style="text-align:justify;">Today, we will riffle through a very simple, yet common issue &#8211; <em><strong>How to unlock a locked &#8220;sa&#8221; login?</strong></em></p>
<p style="text-align:justify;">It is quite a common practice that SQL Server is hosted on a separate server than application server. In most cases, SQL Server ports or IP are exposed to the web, which makes them risk prone. For hackers, System Admin login &#8220;sa&#8221; is the preferred account which they use for hacking. In fact, a majority of hackers try to hack into SQL Server by attempting to login using &#8220;sa&#8221; account. Once hackers gain access to server using &#8220;sa&#8221; login, they get a complete control over the SQL Server.</p>
<p style="text-align:justify;">Hackers apply Brute Force method to hack &#8220;sa&#8221; login. Brute Force method is an attempt to guess a password using every possible combination. Be it in your machine where SQL Server is hosted or in your domain, if you have a policy setting that disables any account after a certain number of unsuccessful attempts, it will also disable all your SQL Server logins including &#8220;sa&#8221; login. In this scenario, SQL Server will display the following error:</p>
<p style="text-align:justify;"><span style="color:#ff0000;">msg: 18486<br />
Login failed for user &#8217;sa&#8217; because the account is currently locked out. The system administrator can unlock it.<br />
</span>
</p>
<p style="text-align:justify;"><strong>Fix/Solution/Workaround:</strong></p>
<p style="text-align:justify;">1) Disable the policy on your system or on your domain level. However, this may not be the most appropriate option as it will adversely affect your security protection level.</p>
<p style="text-align:justify;">2) If this is a one-time issue, enable &#8220;sa&#8221; login WITH changing password of &#8220;sa&#8221; login.</p>
<p style="text-align:justify;"><code style="font-size:12px;"><span style="color:blue;">ALTER </span><span style="color:black;">LOGIN sa </span><span style="color:blue;">WITH </span><span style="color:black;">PASSWORD </span><span style="color:blue;">= </span><span style="color:red;">'yourpass' </span><span style="color:black;">UNLOCK </span><span style="color:gray;">;<br />
</span><span style="color:black;">GO</span></code>
</p>
<p style="text-align:justify;">3) If this is a one-time issue, enable &#8220;sa&#8221; login WITHOUT changing password of &#8220;sa&#8221; login.</p>
<p style="text-align:justify;"><code style="font-size:12px;"><span style="color:blue;">ALTER </span><span style="color:black;">LOGIN sa </span><span style="color:blue;">WITH </span><span style="color:black;">CHECK_POLICY </span><span style="color:blue;">= OFF</span><span style="color:gray;">;<br />
</span><span style="color:blue;">ALTER </span><span style="color:black;">LOGIN sa </span><span style="color:blue;">WITH </span><span style="color:black;">CHECK_POLICY </span><span style="color:blue;">= ON</span><span style="color:gray;">;<br />
</span><span style="color:black;">GO</span></code>
</p>
<p style="text-align:justify;">4) If you are not using &#8220;sa&#8221; login, switch your authentication from mixed mode authentication to windows authentication to remove your &#8220;sa&#8221; login account.</p>
<p style="text-align:justify;">5) <strong>BEST Practice: </strong>Create another user with systemadmin role having the same rights as &#8220;sa&#8221; login and let &#8220;sa&#8221; login get disabled. Use the newly created account as this will not be exposed on the Internet and for hackers it will be a tough nut to crack! They will find it difficult to guess the right password and moreover, they will not be able to do Brute Force attack over it.</p>
<p style="text-align:justify;">I am eager to know if there are other options to solve this problem.</p>
<p style="text-align:justify;">If you simply want to change the &#8220;sa&#8221; password, you can follow my previous article <strong><a href="http://blog.sqlauthority.com/2007/12/29/sql-server-change-password-of-sa-login-using-management-studio/" target="_blank">SQL SERVER &#8211; Change Password of SA Login Using Management Studio</a></strong>.</p>
<p style="text-align:justify;">Please note that it is not mandatory to reboot SQL Server or restart SQL Server services after changing the password for &#8220;sa&#8221; login. If you are interested, go through all the <a href="http://blog.sqlauthority.com/2007/12/29/sql-server-change-password-of-sa-login-using-management-studio/" target="_blank">comments </a>and bring forth your opinion about this discussion.</p>
<p style="text-align:justify;">Reference : <strong>Pinal Dave (<a href="http://blog.sqlauthority.com/" target="_blank">http://blog.SQLAuthority.com</a>)</strong></p>
<p style="text-align:justify;">
Posted in Pinal Dave, SQL, SQL Authority, SQL Error Messages, SQL Query, SQL Scripts, SQL Security, SQL Server, SQL Tips and Tricks, SQLServer, T SQL, Technology Tagged: hacking <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sqlauthority.wordpress.com/4488/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sqlauthority.wordpress.com/4488/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sqlauthority.wordpress.com/4488/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sqlauthority.wordpress.com/4488/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sqlauthority.wordpress.com/4488/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sqlauthority.wordpress.com/4488/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sqlauthority.wordpress.com/4488/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sqlauthority.wordpress.com/4488/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sqlauthority.wordpress.com/4488/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sqlauthority.wordpress.com/4488/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&blog=668536&post=4488&subd=sqlauthority&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://blog.sqlauthority.com/2009/04/23/sql-server-fix-error-18486-login-failed-for-user-sa-because-the-account-is-currently-locked-out-the-system-administrator-can-unlock-it-unlock-sa-login/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/48aa5a2264e8a27d802bb22ab6ccf688?s=96&#38;d=identicon" medium="image">
			<media:title type="html">pinaldave</media:title>
		</media:content>
	</item>
		<item>
		<title>SQL SERVER &#8211; Check if Current Login is Part of Server Role Member</title>
		<link>http://blog.sqlauthority.com/2009/04/14/sql-server-check-if-current-login-is-part-of-server-role-member/</link>
		<comments>http://blog.sqlauthority.com/2009/04/14/sql-server-check-if-current-login-is-part-of-server-role-member/#comments</comments>
		<pubDate>Tue, 14 Apr 2009 01:30:23 +0000</pubDate>
		<dc:creator>pinaldave</dc:creator>
				<category><![CDATA[Pinal Dave]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[SQL Add-On]]></category>
		<category><![CDATA[SQL Authority]]></category>
		<category><![CDATA[SQL Query]]></category>
		<category><![CDATA[SQL Scripts]]></category>
		<category><![CDATA[SQL Security]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SQL Tips and Tricks]]></category>
		<category><![CDATA[SQLServer]]></category>
		<category><![CDATA[T SQL]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=4333</guid>
		<description><![CDATA[I often work on consulting projects with umpteen clients from across the globe. The nature of the works I usually receive necessitates me to take on the role of a system admin. Now, this role is trailed by come common issues. This article revolves around one such concern.
Most of the time, I get login and [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&blog=668536&post=4333&subd=sqlauthority&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p style="text-align:justify;">I often work on consulting projects with umpteen clients from across the globe. The nature of the works I usually receive necessitates me to take on the role of a system admin. Now, this role is trailed by come common issues. This article revolves around one such concern.</p>
<p style="text-align:justify;">Most of the time, I get login and DBA from my clients. However, sometimes I face login-related problems, primarily because my clients forget to confer admin rights on me. Anticipating this situation I perform a simple task, which saves my time and saves me from exasperation.  Whenever I receive a server login I run the following query to verify if  the client has assigned me the role of system admin or not.</p>
<p style="text-align:justify;"><code style="font-size:12px;"><span style="color:blue;">SELECT </span><span style="color:magenta;">IS_SRVROLEMEMBER</span><span style="color:gray;">(</span><span style="color:red;">'sysadmin'</span><span style="color:gray;">);</span></code></p>
<p style="text-align:justify;">If I have been assigned system admin role then the result will be 1 else it will be 0.</p>
<p style="text-align:justify;"><img class="alignnone" src="http://www.pinaldave.com/bimg/isrole.jpg" alt="" width="416" height="167" /></p>
<p style="text-align:justify;">
<p style="text-align:justify;">I have listed below valid roles that can be verified using the above function.</p>
<p style="padding-left:60px;text-align:justify;">sysadmin<br />
dbcreator<br />
diskadmin<br />
processadmin<br />
serveradmin<br />
setupadmin<br />
securityadmin
</p>
<p style="text-align:justify;">If you pass an invalid role to the above function, it will return value NULL.</p>
<p style="text-align:justify;"><img class="alignnone" src="http://www.pinaldave.com/bimg/isrole1.jpg" alt="" width="458" height="140" /></p>
<p style="text-align:justify;">
<p style="text-align:justify;">I hope my article is clear to all my readers. Please send me your feedback. I want my readers to come up with more issues that need to be tackled.</p>
<p style="text-align:justify;">Reference : <strong>Pinal Dave (<a href="http://blog.sqlauthority.com/" target="_blank">http://blog.sqlauthority.com</a>)</strong></p>
Posted in Pinal Dave, SQL, SQL Add-On, SQL Authority, SQL Query, SQL Scripts, SQL Security, SQL Server, SQL Tips and Tricks, SQLServer, T SQL, Technology  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sqlauthority.wordpress.com/4333/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sqlauthority.wordpress.com/4333/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sqlauthority.wordpress.com/4333/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sqlauthority.wordpress.com/4333/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sqlauthority.wordpress.com/4333/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sqlauthority.wordpress.com/4333/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sqlauthority.wordpress.com/4333/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sqlauthority.wordpress.com/4333/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sqlauthority.wordpress.com/4333/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sqlauthority.wordpress.com/4333/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&blog=668536&post=4333&subd=sqlauthority&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://blog.sqlauthority.com/2009/04/14/sql-server-check-if-current-login-is-part-of-server-role-member/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/48aa5a2264e8a27d802bb22ab6ccf688?s=96&#38;d=identicon" medium="image">
			<media:title type="html">pinaldave</media:title>
		</media:content>

		<media:content url="http://www.pinaldave.com/bimg/isrole.jpg" medium="image" />

		<media:content url="http://www.pinaldave.com/bimg/isrole1.jpg" medium="image" />
	</item>
		<item>
		<title>SQL SERVER &#8211; Fix : Error : Msg 9803, Level 16. Invalid data for type &#8220;numeric&#8221; &#8211; Data Type Mapping for Oracle Publishers</title>
		<link>http://blog.sqlauthority.com/2009/04/09/sql-server-fix-error-msg-9803-level-16-invalid-data-for-type-numeric-data-type-mapping-for-oracle-publishers/</link>
		<comments>http://blog.sqlauthority.com/2009/04/09/sql-server-fix-error-msg-9803-level-16-invalid-data-for-type-numeric-data-type-mapping-for-oracle-publishers/#comments</comments>
		<pubDate>Thu, 09 Apr 2009 01:30:39 +0000</pubDate>
		<dc:creator>pinaldave</dc:creator>
				<category><![CDATA[Pinal Dave]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[SQL Authority]]></category>
		<category><![CDATA[SQL Error Messages]]></category>
		<category><![CDATA[SQL Query]]></category>
		<category><![CDATA[SQL Scripts]]></category>
		<category><![CDATA[SQL Security]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SQL Tips and Tricks]]></category>
		<category><![CDATA[T SQL]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Oracle]]></category>

		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=4267</guid>
		<description><![CDATA[My present article talks about an error that you will encounter when connecting to Oracle database using OPENQUERY.
The error that eventuates is as follows:
Msg 9803, Level 16, State 1, Line 1
Invalid data for type &#8220;numeric&#8221;.

Fix/Solution/Workaround:
As far as I can discern, the above error occurs due to numeric precision or numeric definition mismatch. The number field [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&blog=668536&post=4267&subd=sqlauthority&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p style="text-align:justify;">My present article talks about an error that you will encounter when connecting to Oracle database using OPENQUERY.</p>
<p style="text-align:justify;">The error that eventuates is as follows:</p>
<p style="text-align:justify;"><span style="color:#ff0000;">Msg 9803, Level 16, State 1, Line 1<br />
Invalid data for type &#8220;numeric&#8221;.</span>
</p>
<p style="text-align:justify;"><strong>Fix/Solution/Workaround:</strong></p>
<p style="text-align:justify;">As far as I can discern, the above error occurs due to numeric precision or numeric definition mismatch. The number field of SQL Server does not appropriately match with the number field of Oracle. In fact, apart from number field there are several other data types that do not match.</p>
<p style="text-align:justify;">I am including the following sample query having NumberCol that is Integer field of SQL Server and it needs to be converted To_Char to match up. NumberCol can be matched to Numeric in Oracle as well.</p>
<p style="text-align:justify;"><code style="font-size:12px;"><span style="color:blue;">SELECT </span><span style="color:magenta;">CONVERT</span><span style="color:gray;">(</span><span style="color:blue;">INT</span><span style="color:gray;">, </span><span style="color:black;">NumberCol</span><span style="color:gray;">) </span><span style="color:blue;">AS </span><span style="color:black;">NumberCol<br />
</span><span style="color:blue;">FROM OPENQUERY </span><span style="color:gray;">(</span><span style="color:black;">YourConnectionMethod</span><span style="color:gray;">, </span><span style="color:red;">'SELECT TO_CHAR(NumberCol) AS NumberCol FROM RemoteTbl'</span><span style="color:gray;">); </span></code>
</p>
<p style="text-align:justify;">Do read the article of MSDN to have a sound knowledge about <strong><a href="http://msdn.microsoft.com/en-us/library/ms151817.aspx" target="_blank">Data Type Mapping for Oracle Publishers</a></strong>.</p>
<p style="text-align:justify;">Please drop a line to me and let me have your doubts and questions. Your suggestions are always welcome!</p>
<p style="text-align:justify;"><strong><a href="http://msdn.microsoft.com/en-us/library/ms151817.aspx" target="_blank"></a></strong></p>
<p style="text-align:justify;"><strong></strong></p>
<p style="text-align:justify;">Reference :<strong> Pinal Dave (<a href="http://blog.sqlauthority.com/" target="_blank">http://blog.sqlauthority.com</a>)</strong></p>
Posted in Pinal Dave, SQL, SQL Authority, SQL Error Messages, SQL Query, SQL Scripts, SQL Security, SQL Server, SQL Tips and Tricks, T SQL, Technology Tagged: Oracle <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sqlauthority.wordpress.com/4267/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sqlauthority.wordpress.com/4267/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sqlauthority.wordpress.com/4267/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sqlauthority.wordpress.com/4267/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sqlauthority.wordpress.com/4267/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sqlauthority.wordpress.com/4267/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sqlauthority.wordpress.com/4267/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sqlauthority.wordpress.com/4267/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sqlauthority.wordpress.com/4267/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sqlauthority.wordpress.com/4267/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&blog=668536&post=4267&subd=sqlauthority&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://blog.sqlauthority.com/2009/04/09/sql-server-fix-error-msg-9803-level-16-invalid-data-for-type-numeric-data-type-mapping-for-oracle-publishers/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/48aa5a2264e8a27d802bb22ab6ccf688?s=96&#38;d=identicon" medium="image">
			<media:title type="html">pinaldave</media:title>
		</media:content>
	</item>
		<item>
		<title>SQL SERVER &#8211; 2008 &#8211; Activity Monitor is Empty &#8211; Fix Activity Monitor for All Users</title>
		<link>http://blog.sqlauthority.com/2009/03/22/sql-server-2008-activity-monitor-is-empty-fix-activity-monitor-for-all-users/</link>
		<comments>http://blog.sqlauthority.com/2009/03/22/sql-server-2008-activity-monitor-is-empty-fix-activity-monitor-for-all-users/#comments</comments>
		<pubDate>Sun, 22 Mar 2009 01:30:17 +0000</pubDate>
		<dc:creator>pinaldave</dc:creator>
				<category><![CDATA[Pinal Dave]]></category>
		<category><![CDATA[Readers Contribution]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[SQL Authority]]></category>
		<category><![CDATA[SQL Error Messages]]></category>
		<category><![CDATA[SQL Performance]]></category>
		<category><![CDATA[SQL Query]]></category>
		<category><![CDATA[SQL Scripts]]></category>
		<category><![CDATA[SQL Security]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SQL Tips and Tricks]]></category>
		<category><![CDATA[T SQL]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[SQL Activity Monitor]]></category>

		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=3862</guid>
		<description><![CDATA[This article is outcome of the technical discussion of activity monitor and its behavior with my friend and SQL Expert Tejas Shah. Tejas told me that he does not like to re-write content from MSDN but rather prefer to write real life scenarios, as that prepares him to become better SQL Expert. While discussing about [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&blog=668536&post=3862&subd=sqlauthority&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p style="text-align:justify;">This article is outcome of the technical discussion of activity monitor and its behavior with my friend and SQL Expert <strong><a href="http://tejasnshah.wordpress.com/" target="_blank">Tejas Shah</a></strong>. Tejas told me that he does not like to re-write content from MSDN but rather prefer to write real life scenarios, as that prepares him to become better SQL Expert. While discussing about Activity Monitor he informed that activity monitor throws an error when there is permissions issue. He has even blogged about <a href="http://tejasnshah.wordpress.com/2009/03/22/sql-server-unable-to-launch-activity-monitor-how-to-give-view-server-state-permissions-to-launch-activity-monitor/" target="_blank">how to give permissions to user to launch activity monitor</a> on his blog . Tejas asked me to write on the same subject for SQL Server 2008. Here is the article covering the discussion I had with Tejas.</p>
<p style="text-align:justify;">I have user called &#8216;ActivityUser&#8217; when turned on Activity Monitor (while logging in with user ActivityUser&#8217;) it does not have show anything in Activity Monitor.</p>
<p style="text-align:justify;"><a href="http://www.pinaldave.com/bimg/avmon/av1.jpg"><img class="alignnone" src="http://www.pinaldave.com/bimg/avmon/av1_s.jpg" alt="" width="500" height="263" /></a></p>
<p style="text-align:justify;">The issue here is permissions issue. If user ActivityUser is given all the necessary permission it will start showing up data in Activity Monitor. Activity Monitor is new tool in SQL Server which displays activity in five sections. 1) Overview, 2) Processes, 3) Resources Waits, 4) Data File I/O, 5) Recent Expensive Queries. It is one of the new and very useful tool introduced by SQL Server.</p>
<p style="text-align:justify;">Activity Monitor captures all the information at server level. For the same reason we need to give <em><strong>&#8220;View Server State&#8221;</strong></em> permission to user name to view data of Activity Monitor.We can give permission either using T-SQL or using SSMS.</p>
<p style="text-align:justify;">T-SQL to give permission to user to view Activity Monitor:</p>
<p style="text-align:justify;"><img class="alignnone" src="http://www.pinaldave.com/bimg/avmon/av2.jpg" alt="" width="429" height="232" /></p>
<p style="text-align:justify;">SSMS to give permission to user to view Activity Monitor:</p>
<p style="text-align:justify;"><img class="alignnone" src="http://www.pinaldave.com/bimg/avmon/av3.jpg" alt="" width="500" height="449" /></p>
<p style="text-align:justify;">Once permissions is given to user, it displays the data in Activity Monitor. Click on images to enlarge the images.</p>
<p style="text-align:justify;"><a href="http://www.pinaldave.com/bimg/avmon/av4.jpg"><img class="alignnone" src="http://www.pinaldave.com/bimg/avmon/av4_s.jpg" alt="" width="500" height="281" /></a></p>
<p style="text-align:justify;">Additionally, note that if you are user belonging to sysadmin role, you can always see all the data in Activity Monitor without additional permissions.</p>
<p style="text-align:justify;">Reference : <strong>Pinal Dave (<a href="http://blog.sqlauthority.com/" target="_blank">http://blog.sqlauthority.com</a>)</strong></p>
Posted in Pinal Dave, Readers Contribution, SQL, SQL Authority, SQL Error Messages, SQL Performance, SQL Query, SQL Scripts, SQL Security, SQL Server, SQL Tips and Tricks, T SQL, Technology Tagged: SQL Activity Monitor <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sqlauthority.wordpress.com/3862/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sqlauthority.wordpress.com/3862/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sqlauthority.wordpress.com/3862/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sqlauthority.wordpress.com/3862/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sqlauthority.wordpress.com/3862/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sqlauthority.wordpress.com/3862/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sqlauthority.wordpress.com/3862/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sqlauthority.wordpress.com/3862/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sqlauthority.wordpress.com/3862/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sqlauthority.wordpress.com/3862/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&blog=668536&post=3862&subd=sqlauthority&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://blog.sqlauthority.com/2009/03/22/sql-server-2008-activity-monitor-is-empty-fix-activity-monitor-for-all-users/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/48aa5a2264e8a27d802bb22ab6ccf688?s=96&#38;d=identicon" medium="image">
			<media:title type="html">pinaldave</media:title>
		</media:content>

		<media:content url="http://www.pinaldave.com/bimg/avmon/av1_s.jpg" medium="image" />

		<media:content url="http://www.pinaldave.com/bimg/avmon/av2.jpg" medium="image" />

		<media:content url="http://www.pinaldave.com/bimg/avmon/av3.jpg" medium="image" />

		<media:content url="http://www.pinaldave.com/bimg/avmon/av4_s.jpg" medium="image" />
	</item>
		<item>
		<title>SQL SERVER &#8211; Disable Windows Authentication &#8211; Remove Windows Authentication Login Account</title>
		<link>http://blog.sqlauthority.com/2009/02/24/sql-server-disable-windows-authentication-remove-windows-authentication-login-account/</link>
		<comments>http://blog.sqlauthority.com/2009/02/24/sql-server-disable-windows-authentication-remove-windows-authentication-login-account/#comments</comments>
		<pubDate>Tue, 24 Feb 2009 01:30:18 +0000</pubDate>
		<dc:creator>pinaldave</dc:creator>
				<category><![CDATA[Pinal Dave]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[SQL Authority]]></category>
		<category><![CDATA[SQL Query]]></category>
		<category><![CDATA[SQL Security]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SQL Tips and Tricks]]></category>
		<category><![CDATA[T SQL]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[SQL Login]]></category>

		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=2795</guid>
		<description><![CDATA[I just received following email from one of the blog reader.
Question : &#8220;How to disable Windows Authentication?&#8221;
Answer : It can not be disabled. Windows Authentication is the most secure way to login in system.
Reference : Pinal Dave (http://blog.SQLAuthority.com)
Posted in Pinal Dave, SQL, SQL Authority, SQL Query, SQL Security, SQL Server, SQL Tips and Tricks, T [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&blog=668536&post=2795&subd=sqlauthority&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p style="text-align:justify;">I just received following email from one of the blog reader.</p>
<p style="text-align:justify;"><strong>Question : </strong>&#8220;How to disable Windows Authentication?&#8221;</p>
<p style="text-align:justify;"><strong>Answer :</strong> It can not be disabled. Windows Authentication is the most secure way to login in system.</p>
<p style="text-align:justify;">Reference : <strong>Pinal Dave (<a href="http://blog.SQLAuthority.com" target="_blank">http://blog.SQLAuthority.com</a>)</strong></p>
Posted in Pinal Dave, SQL, SQL Authority, SQL Query, SQL Security, SQL Server, SQL Tips and Tricks, T SQL, Technology Tagged: SQL Login <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sqlauthority.wordpress.com/2795/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sqlauthority.wordpress.com/2795/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sqlauthority.wordpress.com/2795/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sqlauthority.wordpress.com/2795/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sqlauthority.wordpress.com/2795/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sqlauthority.wordpress.com/2795/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sqlauthority.wordpress.com/2795/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sqlauthority.wordpress.com/2795/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sqlauthority.wordpress.com/2795/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sqlauthority.wordpress.com/2795/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&blog=668536&post=2795&subd=sqlauthority&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://blog.sqlauthority.com/2009/02/24/sql-server-disable-windows-authentication-remove-windows-authentication-login-account/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/48aa5a2264e8a27d802bb22ab6ccf688?s=96&#38;d=identicon" medium="image">
			<media:title type="html">pinaldave</media:title>
		</media:content>
	</item>
		<item>
		<title>SQL SERVER &#8211; Find Current Location of Data and Log File of All the Database</title>
		<link>http://blog.sqlauthority.com/2009/02/17/sql-server-find-current-location-of-data-and-log-file-of-all-the-database/</link>
		<comments>http://blog.sqlauthority.com/2009/02/17/sql-server-find-current-location-of-data-and-log-file-of-all-the-database/#comments</comments>
		<pubDate>Tue, 17 Feb 2009 01:30:45 +0000</pubDate>
		<dc:creator>pinaldave</dc:creator>
				<category><![CDATA[Pinal Dave]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[SQL Authority]]></category>
		<category><![CDATA[SQL Backup and Restore]]></category>
		<category><![CDATA[SQL Documentation]]></category>
		<category><![CDATA[SQL Query]]></category>
		<category><![CDATA[SQL Scripts]]></category>
		<category><![CDATA[SQL Security]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SQL System Table]]></category>
		<category><![CDATA[SQL Tips and Tricks]]></category>
		<category><![CDATA[T SQL]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=2593</guid>
		<description><![CDATA[As I am doing lots of experiments on my SQL Server test box, I sometime gets too many files in SQL Server data installation folder &#8211; the place where I have all the .mdf and .ldf files are stored. I often go to that folder and clean up all unnecessary files I have left there [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&blog=668536&post=2593&subd=sqlauthority&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p style="text-align:justify;">As I am doing lots of experiments on my SQL Server test box, I sometime gets too many files in SQL Server data installation folder &#8211; the place where I have all the .mdf and .ldf files are stored. I often go to that folder and clean up all unnecessary files I have left there taking up my hard drive space. I run following query to find out which .mdf and .ldf files are used and delete all other files. If your SQL Server is up and running OS will not let you delete .mdf and .ldf files any way giving you error that file already in use. This list also helps sometime to do documentation of which files are in being used by which database.</p>
<p style="text-align:justify;"><code style="font-size:12px;"><span style="color:blue;">SELECT </span><span style="color:black;">name</span><span style="color:gray;">, </span><span style="color:black;">physical_name </span><span style="color:blue;">AS </span><span style="color:black;">current_file_location<br />
</span><span style="color:blue;">FROM </span><span style="color:black;">sys.master_files</span></code>
</p>
<p style="text-align:justify;">Following is the output of files used by my SQL Server instance.</p>
<p style="text-align:justify;"><img class="alignnone" src="http://www.pinaldave.com/bimg/mastefiles.jpg" alt="" width="500" height="394" /></p>
<p style="text-align:justify;">Reference : <strong>Pinal Dave (</strong><a href="http://blog.SQLAuthority.com" target="_blank"><strong>http://blog.SQLAuthority.com</strong></a><strong>)</strong></p>
<p style="text-align:justify;">
Posted in Pinal Dave, SQL, SQL Authority, SQL Backup and Restore, SQL Documentation, SQL Query, SQL Scripts, SQL Security, SQL Server, SQL System Table, SQL Tips and Tricks, T SQL, Technology  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sqlauthority.wordpress.com/2593/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sqlauthority.wordpress.com/2593/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sqlauthority.wordpress.com/2593/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sqlauthority.wordpress.com/2593/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sqlauthority.wordpress.com/2593/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sqlauthority.wordpress.com/2593/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sqlauthority.wordpress.com/2593/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sqlauthority.wordpress.com/2593/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sqlauthority.wordpress.com/2593/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sqlauthority.wordpress.com/2593/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&blog=668536&post=2593&subd=sqlauthority&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://blog.sqlauthority.com/2009/02/17/sql-server-find-current-location-of-data-and-log-file-of-all-the-database/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/48aa5a2264e8a27d802bb22ab6ccf688?s=96&#38;d=identicon" medium="image">
			<media:title type="html">pinaldave</media:title>
		</media:content>

		<media:content url="http://www.pinaldave.com/bimg/mastefiles.jpg" medium="image" />
	</item>
		<item>
		<title>SQL SERVER &#8211; Reasons to Backup Master Database &#8211; Why Should Master Database Backedup</title>
		<link>http://blog.sqlauthority.com/2009/02/15/sql-server-reasons-to-backup-master-database-why-should-master-database-backedup/</link>
		<comments>http://blog.sqlauthority.com/2009/02/15/sql-server-reasons-to-backup-master-database-why-should-master-database-backedup/#comments</comments>
		<pubDate>Sun, 15 Feb 2009 01:30:06 +0000</pubDate>
		<dc:creator>pinaldave</dc:creator>
				<category><![CDATA[Best Practices]]></category>
		<category><![CDATA[Pinal Dave]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[SQL Authority]]></category>
		<category><![CDATA[SQL Backup and Restore]]></category>
		<category><![CDATA[SQL Data Storage]]></category>
		<category><![CDATA[SQL Query]]></category>
		<category><![CDATA[SQL Security]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SQL Tips and Tricks]]></category>
		<category><![CDATA[SQL Utility]]></category>
		<category><![CDATA[T SQL]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=2582</guid>
		<description><![CDATA[The most interesting thing about writing blog at SQLAuthority.com is follow up question. Just a day before I wrote article about SQL SERVER &#8211; Restore Master Database &#8211; An Easy Solution, right following it, I received email from user requesting reason for importance of backing up master database.
Master database contains all the system level information [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&blog=668536&post=2582&subd=sqlauthority&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p style="text-align:justify;">The most interesting thing about writing blog at SQLAuthority.com is follow up question. Just a day before I wrote article about <strong><a href="http://blog.sqlauthority.com/2009/02/14/sql-server-restore-master-database-an-easy-solution/" target="_blank">SQL SERVER &#8211; Restore Master Database &#8211; An Easy Solution</a></strong>, right following it, I received email from user requesting reason for importance of backing up master database.</p>
<p style="text-align:justify;">Master database contains all the system level information of server. Information about all the login account, system configurations and information required to access all the other database are stored in master database. If master database is damaged, it will be difficult to use any other database in SQL Server and that makes it most important database of the SQL Server.</p>
<p style="text-align:justify;">Let us understand the important of the master database using an example. We will take example of SQL Server DBA and follow his timeline. Make sure to understand it correctly, as I have small question at the end of the timeline.</p>
<p style="text-align:justify;">9:00 AM &#8211; DBA takes backup of the master database.<br />
10:00 AM &#8211; DBA creates new Database named <em><strong>AfterMaster</strong></em>.<br />
11:00 AM &#8211; DBA restores the master database backup taken at 9:00 AM.<br />
12:00 PM &#8211; I have following two questions for the DBA :</p>
<p style="text-align:justify;"><em><strong>Question 1)</strong> What will be the state of the database AfterMaster? If AfterMaster database will be in active state after restoring master database?<br />
<strong>Question 2) </strong>What should be the next step after restoring master database?</em>
</p>
<p style="text-align:justify;">Let us understand the answer of question.</p>
<p style="text-align:justify;"><em><strong>Answer 1)</strong></em> Once master database is restored it will have no record of AfterMaster database in its system database and it will not recognize it.<br />
<em><strong>Answer 2)</strong></em> If master database is restored from backup all the operation which are done after last master database backup should be repeated in order to bring SQL Server in the current operational state. In our case, the database files (ldf and mdf) of AfterMaster database will still exists on server. They should be reattached to the server. You can search about how to attach mdf and ldf file at <strong><a href="http://search.sqlauthority.com" target="_blank">Search@SQLAuthority.com</a></strong>.
</p>
<p style="text-align:justify;">It is clear from our example that master database contains user login, files, filegroups and server wide settings.</p>
<p style="text-align:justify;">In summary, it is extremely important to take backup of the master database.</p>
<p style="text-align:justify;">Reference : <strong>Pinal Dave (</strong><a href="http://blog.SQLAuthority.com" target="_blank"><strong>http://blog.SQLAuthority.com</strong></a><strong>)</strong></p>
Posted in Best Practices, Pinal Dave, SQL, SQL Authority, SQL Backup and Restore, SQL Data Storage, SQL Query, SQL Security, SQL Server, SQL Tips and Tricks, SQL Utility, T SQL, Technology  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sqlauthority.wordpress.com/2582/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sqlauthority.wordpress.com/2582/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sqlauthority.wordpress.com/2582/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sqlauthority.wordpress.com/2582/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sqlauthority.wordpress.com/2582/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sqlauthority.wordpress.com/2582/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sqlauthority.wordpress.com/2582/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sqlauthority.wordpress.com/2582/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sqlauthority.wordpress.com/2582/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sqlauthority.wordpress.com/2582/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&blog=668536&post=2582&subd=sqlauthority&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://blog.sqlauthority.com/2009/02/15/sql-server-reasons-to-backup-master-database-why-should-master-database-backedup/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/48aa5a2264e8a27d802bb22ab6ccf688?s=96&#38;d=identicon" medium="image">
			<media:title type="html">pinaldave</media:title>
		</media:content>
	</item>
		<item>
		<title>SQL SERVER &#8211; Restore Master Database &#8211; An Easy Solution</title>
		<link>http://blog.sqlauthority.com/2009/02/14/sql-server-restore-master-database-an-easy-solution/</link>
		<comments>http://blog.sqlauthority.com/2009/02/14/sql-server-restore-master-database-an-easy-solution/#comments</comments>
		<pubDate>Sat, 14 Feb 2009 01:30:35 +0000</pubDate>
		<dc:creator>pinaldave</dc:creator>
				<category><![CDATA[Pinal Dave]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[SQL Add-On]]></category>
		<category><![CDATA[SQL Authority]]></category>
		<category><![CDATA[SQL Backup and Restore]]></category>
		<category><![CDATA[SQL Query]]></category>
		<category><![CDATA[SQL Scripts]]></category>
		<category><![CDATA[SQL Security]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SQL Tips and Tricks]]></category>
		<category><![CDATA[SQL Utility]]></category>
		<category><![CDATA[T SQL]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=2575</guid>
		<description><![CDATA[Today we will go over two step easy method to restore &#8216;master&#8217; database. It is really unusal to have need of restoring the master database. In very rare situation this need should arises. It is important to have full backup of master database, without full backup file of master database it can not be restored.
It [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&blog=668536&post=2575&subd=sqlauthority&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p style="text-align:justify;">Today we will go over two step easy method to restore &#8216;master&#8217; database. It is really unusal to have need of restoring the master database. In very rare situation this need should arises. It is important to have full backup of master database, without full backup file of master database it can not be restored.</p>
<p style="text-align:justify;">It is necessary to start SQL Server in single user mode before master database can be restored. It is very easy to start SQL Server server in single user mode. Follow the tutorial <strong><a href="http://blog.sqlauthority.com/2009/02/10/sql-server-start-sql-server-instance-in-single-user-mode/" target="_blank">SQL SERVER &#8211; Start SQL Server Instance in Single User Mode</a></strong>.</p>
<p style="text-align:justify;">Once SQL Server instance is running in single user mode, immediately connect it using sqlcmd and run following command to restore the master database.</p>
<p style="text-align:justify;"><code style="font-size:12px;"><span style="color:blue;">RESTORE DATABASE </span><span style="color:black;">master </span><span style="color:blue;">FROM DISK = </span><span style="color:red;">'C:\BackupLocation\master.back' </span><span style="color:blue;">WITH </span><span style="color:magenta;">REPLACE</span><span style="color:gray;">;<br />
</span><span style="color:black;">GO </span></code>
</p>
<p style="text-align:justify;"><img class="alignnone" src="http://www.pinaldave.com/bimg/restoremaster.jpg" alt="" width="500" height="251" /></p>
<p style="text-align:justify;">I have tested it couple of times and it has worked fine for me. If you encounter any error please leave a comment and I will do my best to solve it.</p>
<p style="text-align:justify;">Reference : <strong>Pinal Dave (</strong><a href="http://blog.SQLAuthority.com" target="_blank"><strong>http://blog.SQLAuthority.com</strong></a><strong>)</strong></p>
Posted in Pinal Dave, SQL, SQL Add-On, SQL Authority, SQL Backup and Restore, SQL Query, SQL Scripts, SQL Security, SQL Server, SQL Tips and Tricks, SQL Utility, T SQL, Technology  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sqlauthority.wordpress.com/2575/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sqlauthority.wordpress.com/2575/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sqlauthority.wordpress.com/2575/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sqlauthority.wordpress.com/2575/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sqlauthority.wordpress.com/2575/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sqlauthority.wordpress.com/2575/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sqlauthority.wordpress.com/2575/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sqlauthority.wordpress.com/2575/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sqlauthority.wordpress.com/2575/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sqlauthority.wordpress.com/2575/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&blog=668536&post=2575&subd=sqlauthority&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://blog.sqlauthority.com/2009/02/14/sql-server-restore-master-database-an-easy-solution/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/48aa5a2264e8a27d802bb22ab6ccf688?s=96&#38;d=identicon" medium="image">
			<media:title type="html">pinaldave</media:title>
		</media:content>

		<media:content url="http://www.pinaldave.com/bimg/restoremaster.jpg" medium="image" />
	</item>
		<item>
		<title>SQL SERVER &#8211; Start SQL Server Instance in Single User Mode</title>
		<link>http://blog.sqlauthority.com/2009/02/10/sql-server-start-sql-server-instance-in-single-user-mode/</link>
		<comments>http://blog.sqlauthority.com/2009/02/10/sql-server-start-sql-server-instance-in-single-user-mode/#comments</comments>
		<pubDate>Tue, 10 Feb 2009 01:30:32 +0000</pubDate>
		<dc:creator>pinaldave</dc:creator>
				<category><![CDATA[Pinal Dave]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[SQL Add-On]]></category>
		<category><![CDATA[SQL Authority]]></category>
		<category><![CDATA[SQL Query]]></category>
		<category><![CDATA[SQL Scripts]]></category>
		<category><![CDATA[SQL Security]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SQL Server Management Studio]]></category>
		<category><![CDATA[SQL Tips and Tricks]]></category>
		<category><![CDATA[SQL Utility]]></category>
		<category><![CDATA[T SQL]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=2289</guid>
		<description><![CDATA[There are certain situation when user wants to start SQL Server Engine in &#8220;single user&#8221; mode from the start up.
To start SQL Server in single user mode is very simple procedure as displayed below.
Go to SQL Server Configuration Manager and click on  SQL Server 2005 Services. Click on desired SQL Server instance and right click [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&blog=668536&post=2289&subd=sqlauthority&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p style="text-align:justify;">There are certain situation when user wants to start SQL Server Engine in <em><strong>&#8220;single user&#8221;</strong></em> mode from the start up.</p>
<p style="text-align:justify;">To start SQL Server in single user mode is very simple procedure as displayed below.</p>
<p style="text-align:justify;">Go to SQL Server Configuration Manager and click on  SQL Server 2005 Services. Click on desired SQL Server instance and right click go to properties. On the Advance table enter param &#8216;<strong>-m;</strong>&#8216; before existing params in Startup Parameters box.</p>
<p style="text-align:justify;">Make sure that you entered semi-comma after -m. Once that is completed, restart SQL Server services to take this in effect. Once this is done, now you will be only able to connect SQL Server using sqlcmd.</p>
<p style="text-align:justify;"><img class="alignnone" src="http://www.pinaldave.com/bimg/singleuser.jpg" alt="" width="400" height="705" /></p>
<p style="text-align:justify;">Make sure to remove newly added params after required work is completed to restart it in multi user mode.</p>
<p style="text-align:justify;">Reference : <strong>Pinal Dave (</strong><a href="http://blog.SQLAuthority.com" target="_blank"><strong>http://blog.SQLAuthority.com</strong></a><strong>)</strong></p>
Posted in Pinal Dave, SQL, SQL Add-On, SQL Authority, SQL Query, SQL Scripts, SQL Security, SQL Server, SQL Server Management Studio, SQL Tips and Tricks, SQL Utility, T SQL, Technology  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sqlauthority.wordpress.com/2289/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sqlauthority.wordpress.com/2289/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sqlauthority.wordpress.com/2289/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sqlauthority.wordpress.com/2289/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sqlauthority.wordpress.com/2289/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sqlauthority.wordpress.com/2289/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sqlauthority.wordpress.com/2289/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sqlauthority.wordpress.com/2289/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sqlauthority.wordpress.com/2289/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sqlauthority.wordpress.com/2289/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&blog=668536&post=2289&subd=sqlauthority&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://blog.sqlauthority.com/2009/02/10/sql-server-start-sql-server-instance-in-single-user-mode/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/48aa5a2264e8a27d802bb22ab6ccf688?s=96&#38;d=identicon" medium="image">
			<media:title type="html">pinaldave</media:title>
		</media:content>

		<media:content url="http://www.pinaldave.com/bimg/singleuser.jpg" medium="image" />
	</item>
		<item>
		<title>SQL SERVER &#8211; Shrinking NDF and MDF Files &#8211; A Safe Operation</title>
		<link>http://blog.sqlauthority.com/2009/01/25/sql-server-shrinking-ndf-and-mdf-files-a-safe-operation/</link>
		<comments>http://blog.sqlauthority.com/2009/01/25/sql-server-shrinking-ndf-and-mdf-files-a-safe-operation/#comments</comments>
		<pubDate>Sun, 25 Jan 2009 01:30:56 +0000</pubDate>
		<dc:creator>pinaldave</dc:creator>
				<category><![CDATA[Pinal Dave]]></category>
		<category><![CDATA[Readers Question]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[SQL Authority]]></category>
		<category><![CDATA[SQL Data Storage]]></category>
		<category><![CDATA[SQL Performance]]></category>
		<category><![CDATA[SQL Query]]></category>
		<category><![CDATA[SQL Scripts]]></category>
		<category><![CDATA[SQL Security]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SQL Server DBCC]]></category>
		<category><![CDATA[SQL Tips and Tricks]]></category>
		<category><![CDATA[T SQL]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=2118</guid>
		<description><![CDATA[Just a day ago I have received following email from Siddhi and I found it interesting so I am sharing with all of you.
Hello Pinal,


I have seen many blogs from you on SQL server and i have always found them useful and easy to understand. Thanks for all the information you provide.


I have one query [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&blog=668536&post=2118&subd=sqlauthority&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p style="text-align:justify;">Just a day ago I have received following email from <strong>Siddhi </strong>and I found it interesting so I am sharing with all of you.</p>
<div style="padding-left:30px;text-align:justify;"><em>Hello Pinal,</em></div>
<div style="padding-left:30px;text-align:justify;"><em><br />
</em></div>
<div style="padding-left:30px;text-align:justify;"><em>I have seen many blogs from you on SQL server and i have always found them useful and easy to understand. Thanks for all the information you provide.</em></div>
<div style="padding-left:30px;text-align:justify;"><em><br />
</em></div>
<div style="padding-left:30px;text-align:justify;"><em>I have one query about shrinking NDF and MDF files.</em></div>
<div style="padding-left:30px;text-align:justify;"><em><br />
</em></div>
<div style="padding-left:30px;text-align:justify;"><em><strong>Can we shrink NDF and MDF</strong> <strong>files?? If you do so is there any data loss?</strong></em></div>
<div style="padding-left:30px;text-align:justify;"><em><br />
</em></div>
<div style="padding-left:30px;text-align:justify;"><em>I have been shrinking the .LDF files every now and then but I am not too sure about NDF and MDF files.</em></div>
<div style="padding-left:30px;text-align:justify;"><em><br />
</em></div>
<div style="padding-left:30px;text-align:justify;"><em>Can you please answer my query.</em></div>
<div style="padding-left:30px;text-align:justify;"><em><br />
</em></div>
<div style="padding-left:30px;text-align:justify;"><em>Waiting for your early response.</em></div>
<div style="padding-left:30px;text-align:justify;"><em><br />
</em></div>
<div style="padding-left:30px;text-align:justify;"><em>Regards,</em></div>
<div style="padding-left:30px;text-align:justify;"><em>Siddhi</em></div>
<div style="padding-left:30px;text-align:justify;"><em><br />
</em></div>
<div style="text-align:justify;"><strong>Answer:</strong></div>
<div style="text-align:justify;"><strong>Shrinking MDF and NDF file is possible and there is no chance of data loss.</strong></div>
<div style="text-align:justify;"><strong><br />
</strong></div>
<div style="text-align:justify;">It is not always advisable to shrink those file as those files are usually growing. There are cases when one database is separated in multiple database of any large table is dropped from database MDF and NDF can contain large empty space. This is the time they should be shrank. Shrinking database can be many hours process but it there are very slim chances of data lose.</div>
<div style="text-align:justify;">Following is the script to shrink whole database.</div>
<div style="text-align:justify;"><code style="font-size:12px;"><span style="color:blue;">DBCC </span><span style="color:black;">SHRINKDATABASE </span><span style="color:gray;">(</span><span style="color:black;">dbName</span><span style="color:gray;">)</span></code></div>
<div style="text-align:justify;"><span style="color:gray;"><br />
</span></div>
<div style="text-align:justify;">Following is the script to shrink single file.</div>
<div style="text-align:justify;"><code style="font-size:12px;"><span style="color:blue;">DBCC </span><span style="color:black;">SHRINKFILE </span><span style="color:gray;">(</span><span style="color:black;">logicalLogFileName</span><span style="color:gray;">)</span></code></div>
<div style="text-align:justify;"><span style="color:gray;"><br />
</span></div>
<div style="text-align:justify;">To find logicalLogFileName following command has to be ran.</div>
<div style="text-align:justify;"><code style="font-size:12px;"><span style="color:blue;">USE </span><span style="color:black;">dbName<br />
</span><span style="color:blue;">EXEC </span><span style="color:darkred;">sp_helpfile</span></code></div>
<div style="text-align:justify;"><span style="color:darkred;"><br />
</span></div>
<div style="text-align:justify;">Let us understand this using database AdventureWorks.</div>
<div style="text-align:justify;"><code style="font-size:12px;"><span style="color:green;">/* Shrink Whole AdventureWorks Database */<br />
</span><span style="color:blue;">DBCC </span><span style="color:black;">SHRINKDATABASE </span><span style="color:gray;">(</span><span style="color:black;">AdventureWorks</span><span style="color:gray;">)<br />
</span><span style="color:black;">GO<br />
</span><span style="color:green;">/* Get the Logical File Name */<br />
</span><span style="color:blue;">USE </span><span style="color:black;">AdventureWorks<br />
</span><span style="color:blue;">EXEC </span><span style="color:darkred;">sp_helpfile<br />
</span><span style="color:black;">GO<br />
</span><span style="color:green;">/* Shrink MDF File of AdventureWorks Database */<br />
</span><span style="color:blue;">DBCC </span><span style="color:black;">SHRINKFILE </span><span style="color:gray;">(</span><span style="color:black;">AdventureWorks_Data</span><span style="color:gray;">)<br />
</span><span style="color:black;">GO</span></code></div>
<div style="text-align:justify;">Following image of the same process show when whole process is done there will be resultset with information about the new states of the database files.</div>
<div style="text-align:justify;"><img class="alignnone" src="http://www.pinaldave.com/bimg/shrinkdb.gif" alt="" width="445" height="384" /></div>
<div style="text-align:justify;"><span style="color:black;"><br />
</span></div>
<div style="text-align:justify;">Reference : <strong>Pinal Dave (<a href="http://blog.SQLAuthority.com" target="_blank">http://blog.SQLAuthority.com</a>)</strong></div>
Posted in Pinal Dave, Readers Question, SQL, SQL Authority, SQL Data Storage, SQL Performance, SQL Query, SQL Scripts, SQL Security, SQL Server, SQL Server DBCC, SQL Tips and Tricks, T SQL, Technology  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sqlauthority.wordpress.com/2118/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sqlauthority.wordpress.com/2118/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sqlauthority.wordpress.com/2118/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sqlauthority.wordpress.com/2118/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sqlauthority.wordpress.com/2118/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sqlauthority.wordpress.com/2118/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sqlauthority.wordpress.com/2118/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sqlauthority.wordpress.com/2118/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sqlauthority.wordpress.com/2118/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sqlauthority.wordpress.com/2118/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&blog=668536&post=2118&subd=sqlauthority&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://blog.sqlauthority.com/2009/01/25/sql-server-shrinking-ndf-and-mdf-files-a-safe-operation/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/48aa5a2264e8a27d802bb22ab6ccf688?s=96&#38;d=identicon" medium="image">
			<media:title type="html">pinaldave</media:title>
		</media:content>

		<media:content url="http://www.pinaldave.com/bimg/shrinkdb.gif" medium="image" />
	</item>
	</channel>
</rss>