<?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/"
	>

<channel>
	<title>Software Rockstar &#187; SQL Server</title>
	<atom:link href="http://www.softwarerockstar.com/tag/sql-server/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.softwarerockstar.com</link>
	<description>Coaching and mentoring on a journey from a Developer to an IT Leader</description>
	<lastBuildDate>Thu, 12 Nov 2009 18:12:26 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Astoria and Jasper: Old Ideas New Technology</title>
		<link>http://www.softwarerockstar.com/2007/10/astoria-and-jasper-old-ideas-new-technology/</link>
		<comments>http://www.softwarerockstar.com/2007/10/astoria-and-jasper-old-ideas-new-technology/#comments</comments>
		<pubDate>Fri, 19 Oct 2007 01:19:00 +0000</pubDate>
		<dc:creator>SoftwareRockstar</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Other]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[ADO.NET]]></category>
		<category><![CDATA[Agile]]></category>
		<category><![CDATA[AJAX]]></category>
		<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[Cool Tools]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[Visual Studio]]></category>

		<guid isPermaLink="false">http://mharoon.wordpress.com/2007/10/18/astoria-and-jasper-old-ideas-new-technology/</guid>
		<description><![CDATA[SubSonic is an excellent open source DAL generation tool developed by Rob Conery that has been around for almost a year. In most cases SubSonic can just be added to your project, pointed to a databse, and you magically and immediately gain access to a rich and strongly typed object model that can be used [...]]]></description>
			<content:encoded><![CDATA[<div class="imageleft"><img src="http://softwarerockstar.com/wp-content/uploads/2007/10/dotnet.png" alt="Microsoft .NET" title="Microsoft .NET" width="189" height="100" /></div>
<p><a href="http://www.subsonicproject.com/">SubSonic</a> is an excellent open source <a href="http://en.wikipedia.org/wiki/Data_access_layer">DAL</a> generation tool developed by Rob Conery that has been around for almost a year. In most cases <a href="http://www.subsonicproject.com/">SubSonic</a> can just be added to your project, pointed to a databse, and you magically and immediately gain access to a rich and strongly typed object model that can be used to query and persist data to and from your relational data source.</p>
<p><a href="http://www.subsonicproject.com/">SubSonic</a> also has a cool feature called the <a href="http://en.wikipedia.org/wiki/REST">REST</a> handler that essentially allows one to use <a href="http://en.wikipedia.org/wiki/Http">HTTP</a> protocol as an interface to data stored in a back-end relational database. It is <a href="http://en.wikipedia.org/wiki/Uniform_Resource_Identifier">URI</a> based and returns data back in <a href="http://en.wikipedia.org/wiki/Xml">XML</a> format. This data can then be used by decoupled client applications as they see fit. If you have never looked at <a href="http://www.subsonicproject.com/">SubSonic</a>, you owe it to yourself to checkout this very cool tool.</p>
<p>Recently Microsoft unveiled their plans to release similar features codenamed <a href="http://astoria.mslivelabs.com/">Astoria</a> and <a href="http://msdn2.microsoft.com/en-us/data/bb419139.aspx">Jasper</a> with <a href="http://msdn2.microsoft.com/en-us/vstudio/aa700831.aspx">.NET framework 3.5 and Visual Studio 2008</a>. The CTP of <a href="http://astoria.mslivelabs.com/">Astoria</a> and <a href="http://msdn2.microsoft.com/en-us/data/bb419139.aspx">Jasper</a> are available for download from Microsoft.</p>
<p>Jasper is described by Microsoft as:</p>
<blockquote><p>Project Jasper is geared towards iterative and agile development. You can<br />
start interacting with the data in your database without having to create<br />
mapping files or define classes. You can build user interfaces by naming<br />
controls according to your model without worrying about binding code. Project<br />
Jasper is also extensible, allowing you to provide your own business logic and<br />
class model. Since Project Jasper is built on top of the ADO.NET Entity<br />
Framework, it supports rich queries and complex mapping.
</p></blockquote>
<p>Pablo Castro, the mastermind behind Astoria describes it as:</p>
<blockquote><p>The goal of Microsoft Codename Astoria is to enable applications to expose data as a data service that can be consumed by web clients within a corporate network and across the internet. The data service is reachable over HTTP, and URIs are used to identify the various pieces of information available through the service. Interactions with the data service happens in terms of HTTP verbs such as GET, POST, PUT and DELETE, and the data exchanged in those interactions is represented in simple formats such as XML and JSON.</p></blockquote>
<p>The <a href="http://astoria.mslivelabs.com/">Astoria</a> web site also includes <a href="http://astoria.mslivelabs.com/OnlineService.aspx">sample online services</a> that showcases how this new technology can be used. It also allows anyone with a Passport account to design and host their own experimental data services .</p>
]]></content:encoded>
			<wfw:commentRss>http://www.softwarerockstar.com/2007/10/astoria-and-jasper-old-ideas-new-technology/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SQL Server Database Comparison and Synchronization</title>
		<link>http://www.softwarerockstar.com/2007/04/sql-server-database-comparison-and-synchronization/</link>
		<comments>http://www.softwarerockstar.com/2007/04/sql-server-database-comparison-and-synchronization/#comments</comments>
		<pubDate>Wed, 18 Apr 2007 12:02:00 +0000</pubDate>
		<dc:creator>SoftwareRockstar</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Administration]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Cool Tools]]></category>
		<category><![CDATA[Rants & Raves]]></category>
		<category><![CDATA[SQL Server]]></category>

		<guid isPermaLink="false">http://mharoon.wordpress.com/2007/04/18/sql-server-database-comparison-and-synchronization/</guid>
		<description><![CDATA[Since database are usually designed in development environments, migrating changes&#160;over to other environments (e.g. QA and production) is not a trivial task.&#160; This is because SQL Server does not have any built-in tools to compare database schemas.&#160; There are quite a few third-party tools that would make your life easier, most notably, Red Gate&#8217;s SQL [...]]]></description>
			<content:encoded><![CDATA[<div class="imageleft"><img src="http://softwarerockstar.com/wp-content/uploads/2007/04/ms_sql_logo1.gif" alt="SQL Server" width="240" height="118" /></div>
<p>Since database are usually designed in development environments, migrating changes&nbsp;over to other environments (e.g. QA and production) is not a trivial task.&nbsp; This is because SQL Server does not have any built-in tools to compare database schemas.&nbsp; </p>
<p>There are quite a few third-party tools that would make your life easier, most notably, <a title="Red Gate's SQL Compare" href="http://www.red-gate.com/" target="_blank">Red Gate&#8217;s SQL Compare</a>&nbsp;(reasonably priced around $300).</p>
<p>At times, buying a commercial tool is not really an option, so one must resort to googling for free tools.&nbsp; There are three such tools that I am aware of:</p>
<ol>
<li><a title="SQLDBDiff by SQLDBTools" href="http://www.sqldbtools.com/Snapshots.aspx?ProductId=1"><strong>SQLDBDiff by SQLDBTools</strong></a><br />A very decent tool that comes in both freeware and shareware versions.&nbsp; Freeware version is not badly crippled; only advanced features such as multi-database comparison, data content comparison, etc. are disabled.</p>
</li>
<li><a title="Database Schema Comparison Utility" href="http://www.codeproject.com/useritems/DatabaseCompare.asp"><strong>Database Schema Comparison Utility</strong></a><br />This is a Code Project article that comes with C# source code&nbsp;of a schema comparison utility.&nbsp; The utility itself is pretty bare-bone, but gets the job done.
</li>
<li><a title="StarInix Free Database Compare 2.0" href="http://www.starinix.com/sqlcompare02.htm"><strong>StarInix Free Database Compare 2.0</strong></a><br />I have not used this tool, but from the advertised feature list, it looks pretty good.&nbsp; Most notably, in addition to SQL Server, this tool works with Access and MySQL databases.</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.softwarerockstar.com/2007/04/sql-server-database-comparison-and-synchronization/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SQL Server Locking Hints</title>
		<link>http://www.softwarerockstar.com/2007/02/sql-server-locking-hints/</link>
		<comments>http://www.softwarerockstar.com/2007/02/sql-server-locking-hints/#comments</comments>
		<pubDate>Tue, 06 Feb 2007 02:27:00 +0000</pubDate>
		<dc:creator>SoftwareRockstar</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[SQL Server]]></category>

		<guid isPermaLink="false">http://mharoon.wordpress.com/2007/02/05/sql-server-locking-hints/</guid>
		<description><![CDATA[While SQL Server provides automatic data locking mechanism which is good enough for most situations, there are times when developers must provide locking hints in their queries for better performance. There are several locking hints that can be used with SQL Server, however, the two most common ones are as follows: READ COMMITTED This is [...]]]></description>
			<content:encoded><![CDATA[<div class="imageleft"><img src="http://softwarerockstar.com/wp-content/uploads/2007/04/ms_sql_logo1.gif" alt="SQL Server" title="SQL Server" width="240" height="118" class="alignnone size-full wp-image-309" /></div>
<p>While SQL Server provides automatic data locking mechanism which is good enough for most situations, there are times when developers must provide locking hints in their queries for better performance. There are <a href="http://msdn2.microsoft.com/en-us/library/aa213026(SQL.80).aspx">several locking hints</a> that can be used with SQL Server, however, the two most common ones are as follows:</p>
<p><strong><span style="font-size:130%;">READ COMMITTED</span><br />
</strong>This is the default locking strategy used by SQL Server.</p>
<p><strong>PROS: </strong><br />
Guarantees that only committed data is read.</p>
<p><strong>CONS:</strong><br />
If a writer has a lock in place, readers are blocked until the writer releases it&#8217;s lock, hence delaying readers.</p>
<p><strong>EXAMPLE</strong></p>
<pre class="brush: sql">
-- Default behavior; no special hint required
SELECT EmployeeID, EmployeeName FROM Employee
</pre>
</p>
<p><strong><span style="font-size:130%;">NOLOCK or READ UNCOMMITTED</span><br />
</strong>It is best used when approximations are acceptable, or for &#8220;dual-role&#8221; systems where database is responsible for many simultaneous reads and writes.</p>
<p><strong>PROS:</strong><br />
Reads are blazing fast, since any exclusive locks are ignored.  Also Shared Locks are not issued on rows read, so writers do not have to wait for read operations to complete.</p>
<p><strong>CONS:</strong><br />
Data read may not be 100% accurate, since exclusive locks are ignored.</p>
<p><strong>EXAMPLE</strong></p>
<pre class="brush: sql">
-- NOLOCK hint is used
SELECT EmployeeID, EmployeeName WITH (NOLOCK) FROM Employee
</pre></p>
]]></content:encoded>
			<wfw:commentRss>http://www.softwarerockstar.com/2007/02/sql-server-locking-hints/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Get Table Schema Programatically</title>
		<link>http://www.softwarerockstar.com/2006/08/get-table-schema-programatically/</link>
		<comments>http://www.softwarerockstar.com/2006/08/get-table-schema-programatically/#comments</comments>
		<pubDate>Fri, 18 Aug 2006 11:25:00 +0000</pubDate>
		<dc:creator>SoftwareRockstar</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[ADO.NET]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[SQL Server]]></category>

		<guid isPermaLink="false">http://mharoon.wordpress.com/2006/08/18/get-table-schema-programatically/</guid>
		<description><![CDATA[In order to retreive table schema programatically, we can use the GetSchemaTable method of the DataReader as follows: using (OleDbConnection cn = new OleDbConnection()) { OleDbCommand cmd; DataTable schemaTable; OleDbDataReader reader; cn.ConnectionString = @&#34;Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=Northwind;Data Source=(local);&#34;; cn.Open(); cmd = new OleDbCommand(&#34;Employees&#34;, cn); cmd.CommandType = CommandType.TableDirect; using (reader = cmd.ExecuteReader(CommandBehavior.SchemaOnly &#124; CommandBehavior.KeyInfo)) { [...]]]></description>
			<content:encoded><![CDATA[<p>In order to retreive table schema programatically, we can use the <a href="http://support.microsoft.com/kb/310107/EN-US/">GetSchemaTable</a> method of the DataReader as follows:</p>
<pre class="brush: csharp">
using (OleDbConnection cn = new OleDbConnection())
{
    OleDbCommand cmd;
    DataTable schemaTable;
    OleDbDataReader reader;

    cn.ConnectionString = @&quot;Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=Northwind;Data Source=(local);&quot;;
    cn.Open();

    cmd = new OleDbCommand(&quot;Employees&quot;, cn);
    cmd.CommandType = CommandType.TableDirect;

    using (reader = cmd.ExecuteReader(CommandBehavior.SchemaOnly | CommandBehavior.KeyInfo))
    {
        schemaTable = reader.GetSchemaTable();

        foreach (DataRow row in schemaTable.Rows)
        {
            foreach (DataColumn col in schemaTable.Columns)
                Console.WriteLine(col.ColumnName + &quot; = &quot; + row[col].ToString());

            Console.WriteLine();
        }

        reader.Close();
    }

    cn.Close();
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.softwarerockstar.com/2006/08/get-table-schema-programatically/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Client Side Reports in Visual Studio 2005</title>
		<link>http://www.softwarerockstar.com/2006/08/client-side-reports-in-visual-studio-2005/</link>
		<comments>http://www.softwarerockstar.com/2006/08/client-side-reports-in-visual-studio-2005/#comments</comments>
		<pubDate>Thu, 17 Aug 2006 14:13:00 +0000</pubDate>
		<dc:creator>SoftwareRockstar</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Reporting]]></category>
		<category><![CDATA[SQL Reporting Services]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[Visual Studio]]></category>
		<category><![CDATA[WinForms]]></category>

		<guid isPermaLink="false">http://mharoon.wordpress.com/2006/08/17/client-side-reports-in-visual-studio-2005/</guid>
		<description><![CDATA[Perhaps the best kept secret (or at least the least discussed feature) of Visual Studio 2005 is the client-side reports. Client-side reports consists of the Report Viewer Control and it&#8217;s accompanying Report Designer that comes standard with Visual Studio 2005 Professional and up. This feature can be used to develop ASP.NET or WinForms solutions that [...]]]></description>
			<content:encoded><![CDATA[<p>Perhaps the best kept secret (or at least the least discussed feature) of Visual Studio 2005 is the client-side reports. Client-side reports consists of the <a href="http://msdn2.microsoft.com/en-us/library/ms251671.aspx">Report Viewer Control</a> and it&#8217;s accompanying Report Designer that comes standard with Visual Studio 2005 Professional and up.</p>
<p>This feature can be used to develop ASP.NET or <span class="blsp-spelling-error">WinForms</span> solutions that sport <a href="http://microsoft.com/sql/reporting/"><span class="blsp-spelling-error">SQL</span> Server Reporting Services</a> style reports, without having to deploy those reports to a Reporting Server. Reports are deployed as <span class="blsp-spelling-error">RDLC</span> files with your solutions. In fact one doesn&#8217;t even need <span class="blsp-spelling-error">SQL</span> Server, since these reports can be <span class="blsp-spelling-error">programatically</span> bound to objects such as <span class="blsp-spelling-error">DataSets</span>, a huge plus for <span class="blsp-spelling-error">ditributed</span> n-tier designs where the <span class="blsp-spelling-error">UI</span> layer does not have direct access to the data store. This also means that one can use any imaginable back-end data store including XML and <span class="blsp-spelling-error">CSV</span> files as long as data can be loaded into <span class="blsp-spelling-error">binable</span> objects.</p>
<p>The report viewer control is similar to Reporting Services report viewer, with nifty features such as paging, searching, and export (<span class="blsp-spelling-error">PDF</span>, Excel, <span class="blsp-spelling-error">CSV</span>) features. My only complain with the ASP.NET version of the report viewer is that it does not directly support printing. Reports have to be exported to <span class="blsp-spelling-error">PDF</span> in order for one to print. This was a gotcha with the first versions of Reporting Services report viewer as well, but later they added printing support to the control (perhaps through <span class="blsp-spelling-error">ActiveX</span>) in Reporting Services SP1.</p>
<p>You can find more information about this feature at <a href="http://www.gotreportviewer.com/"><span class="blsp-spelling-error">GotReportViewer</span></a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.softwarerockstar.com/2006/08/client-side-reports-in-visual-studio-2005/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Securing ASP.NET 2.0 Apps Using Membership and Role Providers</title>
		<link>http://www.softwarerockstar.com/2006/08/securing-asp-net-2-0-apps-using-membership-and-role-providers/</link>
		<comments>http://www.softwarerockstar.com/2006/08/securing-asp-net-2-0-apps-using-membership-and-role-providers/#comments</comments>
		<pubDate>Thu, 17 Aug 2006 11:55:00 +0000</pubDate>
		<dc:creator>SoftwareRockstar</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Active Directory]]></category>
		<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[SQL Server]]></category>

		<guid isPermaLink="false">http://mharoon.wordpress.com/2006/08/17/securing-asp-net-2-0-apps-using-membership-and-role-providers/</guid>
		<description><![CDATA[I recently designed an intranet application using ASP.NET 2.0 and really loved the membership and role providers that tremendously simplifified our implementation of security features in the application. Membership and role information can be stored in a SQL Server database or another repository such as Active Directory. For our intranet application it made sense to [...]]]></description>
			<content:encoded><![CDATA[<p>I recently designed an intranet application using ASP.NET 2.0 and really loved the membership and role providers that tremendously simplifified our implementation of security features in the application. Membership and role information can be stored in a SQL Server database or another repository such as Active Directory. For our intranet application it made sense to use Active Directory as the membership provider and SQL Server as the role provider.</p>
<p><strong>Configuring Role and Membership Providers:</strong></p>
<p>Essentially everything is configured declaritively using Web.config:</p>
<p>
In the above configuration file, note that we first specify our connection strings starting at line 2. LocalSqlServer points to a SQL Server database which has been configured using <a href="http://msdn2.microsoft.com/en-us/library/x28wfk74.aspx">aspnet_regsql</a>. The second connection string points to the domain controller for membership authentication.</p>
<p>In the authentication section we specify that we are using forms authentication, and provide the URL for our logon page.</p>
<p>In the roleManager section we configure our role provider, pointing back to LocalSqlServer as the role repository.</p>
<p>In the membership section we configure our membership provider pointing back to ADConnectionString (domain controller) specified in the connectionStrings section.</p>
<p>Finally we restrict users from accessing certain folders based on their roles using location sections (role-based security).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.softwarerockstar.com/2006/08/securing-asp-net-2-0-apps-using-membership-and-role-providers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Copy Virtual Machine With SQL Server Installed</title>
		<link>http://www.softwarerockstar.com/2006/08/copy-virtual-machine-with-sql-server-installed/</link>
		<comments>http://www.softwarerockstar.com/2006/08/copy-virtual-machine-with-sql-server-installed/#comments</comments>
		<pubDate>Wed, 16 Aug 2006 11:30:00 +0000</pubDate>
		<dc:creator>SoftwareRockstar</dc:creator>
				<category><![CDATA[Other]]></category>
		<category><![CDATA[Hyper-V]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[Virtual PC]]></category>
		<category><![CDATA[Virtual Server]]></category>

		<guid isPermaLink="false">http://mharoon.wordpress.com/2006/08/16/copy-virtual-machine-with-sql-server-installed/</guid>
		<description><![CDATA[I copied the VHD file of a virtual machine that had SQL Server 2000 installed on it. After running NEWSID from Sysinternals and giving my virtual machine a new name, I had to deal with the fact that SQL Server would not recognize my new machine name. Luckily I found this FAQ on Vyas’s web [...]]]></description>
			<content:encoded><![CDATA[<p>I copied the VHD file of a virtual machine that had SQL Server 2000 installed on it. After running <a href="http://www.sysinternals.com/Utilities/NewSid.html">NEWSID </a>from <a href="http://www.sysinternals.com/">Sysinternals</a> and giving my virtual machine a new name, I had to deal with the fact that SQL Server would not recognize my new machine name. Luckily I found this <a href="http://vyaskn.tripod.com/administration_faq.htm#q5">FAQ</a> on Vyas’s web site that solved my problem. Essentially I had to drop and add my SQL Server as follows in order for things to start working correctly:</p>
<pre class="brush: sql">
EXEC sp_dropserver &#039;Your_OLD_Computer_Name&#039;
GO

EXEC sp_addserver &#039;Your_NEW_Computer_Name&#039;, &#039;local&#039;
GO
</pre>
<p>Restart your SQL Server service. Connect using Query Analyzer and run the following command (It should output the new server name):</p>
<pre class="brush: sql">
SELECT @@SERVERNAME
GO
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.softwarerockstar.com/2006/08/copy-virtual-machine-with-sql-server-installed/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->