<?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>Learning SQL Server</title>
	<atom:link href="http://learningsqlserver.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://learningsqlserver.wordpress.com</link>
	<description>a resource for new SQL Server users and developers</description>
	<lastBuildDate>Thu, 23 Feb 2012 14:38:47 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='learningsqlserver.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://0.gravatar.com/blavatar/434329474ade782b4a85b30d960abf8d?s=96&#038;d=http%3A%2F%2Fs2.wp.com%2Fi%2Fbuttonw-com.png</url>
		<title>Learning SQL Server</title>
		<link>http://learningsqlserver.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://learningsqlserver.wordpress.com/osd.xml" title="Learning SQL Server" />
	<atom:link rel='hub' href='http://learningsqlserver.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Tips for Querying Text Columns in SSMS</title>
		<link>http://learningsqlserver.wordpress.com/2011/03/16/tips-for-querying-text-columns-in-ssms/</link>
		<comments>http://learningsqlserver.wordpress.com/2011/03/16/tips-for-querying-text-columns-in-ssms/#comments</comments>
		<pubDate>Wed, 16 Mar 2011 13:58:14 +0000</pubDate>
		<dc:creator>Jason Roth</dc:creator>
				<category><![CDATA[All]]></category>
		<category><![CDATA[T-SQL]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SQL Server Management Studio]]></category>
		<category><![CDATA[Transact-SQL]]></category>

		<guid isPermaLink="false">http://learningsqlserver.wordpress.com/?p=605</guid>
		<description><![CDATA[SQL Server Management Studio (SSMS) is a great tool for writing and running queries. This post will provide some extra tips on querying text fields in a database table. These include: Query fields with long or formatted text Copying strings by dragging them from the results grid T-SQL query tips for working with strings Long [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=learningsqlserver.wordpress.com&amp;blog=18456007&amp;post=605&amp;subd=learningsqlserver&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a title="SQL Server Management Studio (SSMS) Basics" href="http://learningsqlserver.wordpress.com/2011/02/04/sql-server-management-studio-ssms-basics/">SQL Server Management Studio (SSMS)</a> is a great tool for <a title="SQL Query Tutorial &amp; Tips (Video)" href="http://learningsqlserver.wordpress.com/2011/02/26/sql-query-tutorial-tips-video/">writing and running queries</a>. This post will provide some extra tips on querying text fields in a database table. These include:</p>
<ul>
<li>Query fields with long or formatted text</li>
<li>Copying strings by dragging them from the results grid</li>
<li>T-SQL query tips for working with strings</li>
</ul>
<p><span id="more-605"></span></p>
<h3><span style="text-decoration:underline;">Long Text Fields</span></h3>
<p>In this example, I have a database for documents. In my Documents table, I have a large portion of the United States Declaration of Independence. Here is a screenshot of a query that returns my document text.</p>
<p><img class="aligncenter size-full wp-image-607" title="Text Query" src="http://learningsqlserver.files.wordpress.com/2011/03/textquery1.png?w=640&#038;h=147" alt="Text Query" width="640" height="147" /></p>
<p>In the Results pane, the DocumentText column holds all of the text, but you have to expand the column and scroll to see it all. Also, there are line breaks in my text that don&#8217;t show up in this grid view. One solution is to change the output to &#8220;Results to Text&#8221; instead of the default &#8220;Results to Grid&#8221;. You can do this through the Query menu or by using the toolbar button. After selecting this mode, re-run the query.</p>
<p><img class="aligncenter size-full wp-image-609" title="Results to Text" src="http://learningsqlserver.files.wordpress.com/2011/03/textquery2.png?w=640" alt="Results to Text"   /></p>
<p>Now the document text shows us the line breaks and allows us to more easily select and search it. But the text is cut off after 256 characters. This is a setting that you can change:</p>
<ol>
<li>On the <strong>Tools </strong>menu, select <strong>Options</strong>.</li>
<li>In the <strong>Options </strong>dialog, expand <strong>Query Results</strong>.</li>
<li>Expand <strong>SQL Server</strong>, and then select <strong>Results to Text</strong>.</li>
<li>Change the <strong>Maximum number of characters displayed in each column </strong>to 8192 (the maximum).</li>
</ol>
<p><img class="aligncenter size-full wp-image-610" title="Options Dialog" src="http://learningsqlserver.files.wordpress.com/2011/03/textquery3.png?w=640&#038;h=369" alt="Options Dialog" width="640" height="369" /></p>
<p>Press OK to save this change. But if you run the query again, you won&#8217;t see any change. <span style="text-decoration:underline;"><em><strong>You must close the current query window and open a new one to see the results!</strong></em></span></p>
<p><span style="text-decoration:underline;"><em><strong><img class="aligncenter size-full wp-image-611" title="Text Query Results with More Text" src="http://learningsqlserver.files.wordpress.com/2011/03/textquery4.png?w=640&#038;h=290" alt="Text Query Results with More Text" width="640" height="290" /></strong></em></span></p>
<p>Of course, you&#8217;re still limited to the maximum of 8192 characters, but in all other cases, this can be very helpful if you&#8217;re wanting to examine text with tabs and line breaks.</p>
<h3><span style="text-decoration:underline;"><strong>Dragging Text From Results</strong></span></h3>
<p>My next tip is that you can drag text out of the results window (grid view) into the query window. For example, let&#8217;s say that I ran a query on all of my documents and saw that one was named &#8220;The Declaration of Independence&#8221;. I could create a WHERE clause and type that in. I could also right-click on the cell in the grid view and copy the text. But an even faster solution is to click and drag the text from the cell onto the query window. This works from other places in SSMS too, such as object explorer.</p>
<h3><strong><span style="text-decoration:underline;">T-SQL Text Tips</span></strong></h3>
<p>Finally, there are many functions that help you query text fields. For a full list, see the MSDN topic called <a href="http://msdn.microsoft.com/en-us/library/ms181984.aspx" target="_blank">String Functions (Transact-SQL)</a>. For example, I could find out how many characters are in my document with the LEN function:</p>
<p><pre class="brush: sql; gutter: false;">SELECT LEN(DocumentText) as DocumentLength
FROM Documents
WHERE DocumentName = 'The Declaration of Independence'</pre></p>
<p>In the WHERE clause, you can also do pattern matching with the LIKE keyword and the % wildcard character. For example, the following query returns all documents that have the word &#8220;Declaration&#8221; in the title:</p>
<p><pre class="brush: sql; gutter: false;">SELECT *
FROM Documents
WHERE DocumentName LIKE '%Declaration%'</pre></p>
<p>You can concatenate strings using the plus sign. The following example concatenates the DocumentName and DocumentText columns and calls the derived column DocumentNameAndText.</p>
<p><pre class="brush: sql; gutter: false;">SELECT DocumentName + ' : ' + DocumentText as DocumentNameAndText
FROM Documents</pre></p>
<p>My final tip is that you can cast non-text fields to text. The following example casts the Id field, which is an int, to nvarchar(10) and then concatenates it to the other columns.</p>
<p><pre class="brush: sql; gutter: false;">SELECT CAST(Id as nvarchar(max)) + ' : ' + DocumentName + ' : ' + DocumentText as DocumentAllColumns
FROM Documents</pre></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/learningsqlserver.wordpress.com/605/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/learningsqlserver.wordpress.com/605/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/learningsqlserver.wordpress.com/605/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/learningsqlserver.wordpress.com/605/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/learningsqlserver.wordpress.com/605/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/learningsqlserver.wordpress.com/605/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/learningsqlserver.wordpress.com/605/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/learningsqlserver.wordpress.com/605/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/learningsqlserver.wordpress.com/605/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/learningsqlserver.wordpress.com/605/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/learningsqlserver.wordpress.com/605/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/learningsqlserver.wordpress.com/605/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/learningsqlserver.wordpress.com/605/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/learningsqlserver.wordpress.com/605/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=learningsqlserver.wordpress.com&amp;blog=18456007&amp;post=605&amp;subd=learningsqlserver&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://learningsqlserver.wordpress.com/2011/03/16/tips-for-querying-text-columns-in-ssms/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/8a9fe2d08fee89240904f601e8120016?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">rothja</media:title>
		</media:content>

		<media:content url="http://learningsqlserver.files.wordpress.com/2011/03/textquery1.png" medium="image">
			<media:title type="html">Text Query</media:title>
		</media:content>

		<media:content url="http://learningsqlserver.files.wordpress.com/2011/03/textquery2.png" medium="image">
			<media:title type="html">Results to Text</media:title>
		</media:content>

		<media:content url="http://learningsqlserver.files.wordpress.com/2011/03/textquery3.png" medium="image">
			<media:title type="html">Options Dialog</media:title>
		</media:content>

		<media:content url="http://learningsqlserver.files.wordpress.com/2011/03/textquery4.png" medium="image">
			<media:title type="html">Text Query Results with More Text</media:title>
		</media:content>
	</item>
		<item>
		<title>SQL Server 2008 Express How-To-Guide Videos</title>
		<link>http://learningsqlserver.wordpress.com/2011/03/09/sql-server-2008-express-how-to-guide-videos/</link>
		<comments>http://learningsqlserver.wordpress.com/2011/03/09/sql-server-2008-express-how-to-guide-videos/#comments</comments>
		<pubDate>Wed, 09 Mar 2011 14:36:10 +0000</pubDate>
		<dc:creator>Jason Roth</dc:creator>
				<category><![CDATA[All]]></category>
		<category><![CDATA[Getting Started]]></category>
		<category><![CDATA[Management]]></category>
		<category><![CDATA[T-SQL]]></category>
		<category><![CDATA[Administration]]></category>
		<category><![CDATA[AdventureWorks]]></category>
		<category><![CDATA[Database]]></category>
		<category><![CDATA[Databases]]></category>
		<category><![CDATA[Excel]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SQL Server Management Studio]]></category>
		<category><![CDATA[Videos]]></category>
		<category><![CDATA[Visual Studio]]></category>

		<guid isPermaLink="false">http://learningsqlserver.wordpress.com/?p=580</guid>
		<description><![CDATA[In a previous post, I encouraged you to consider an older video series focussed on learning SQL Server 2005 Express. In this post, I&#8217;d like to highlight a different video series focused on SQL Server 2008 Express: ﻿﻿﻿SQL Server 2008 Express How-To-Guide Series. Here is how I would suggest getting the most out of these [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=learningsqlserver.wordpress.com&amp;blog=18456007&amp;post=580&amp;subd=learningsqlserver&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-thumbnail wp-image-318" title="Movie Reel" src="http://learningsqlserver.files.wordpress.com/2011/01/mc9004316211.png?w=84&#038;h=84" alt="Movie Reel" width="84" height="84" />In a previous post, I encouraged you to consider an <a title="SQL Server Express for Beginners Video Series" href="http://learningsqlserver.wordpress.com/2011/01/31/sql-server-2005-express-for-beginners-video-series/">older video series focussed on learning SQL Server 2005 Express</a>. In this post, I&#8217;d like to highlight a different video series focused on SQL Server 2008 Express: <a href="http://www.msdev.com/Directory/SeriesDescription.aspx?CourseId=124" target="_blank">﻿﻿﻿SQL Server 2008 Express How-To-Guide Series</a>. Here is how I would suggest getting the most out of these videos.</p>
<p><span id="more-580"></span></p>
<p>First, the installation video shows installing an older version of SQL Server 2008. So I would instead use the installation video from our &#8220;Learning SQL Server&#8221; video series here: <a title="How to Install SQL Server 2008 R2 Express" href="http://learningsqlserver.wordpress.com/2011/01/24/how-to-install-sql-server-2008-r2-express/" target="_blank">How to Install SQL Server 2008 R2 Express</a>. Then, if you are using the Express edition to learn, I would recommend watching the following videos in the following order:</p>
<table>
<tbody>
<tr>
<td><a href="http://www.msdev.com/Directory/Description.aspx?eventId=1461" target="_blank">2. SQL Server 2008 Express: How do I import data from another source (Excel, Access, XML, MySQL, &#8230;) into a SQL Server Database?</a></td>
</tr>
<tr>
<td><a href="http://www.msdev.com/Directory/Description.aspx?eventId=1465" target="_blank">3. SQL Server 2008 Express: How do I insert data into a database?</a></td>
</tr>
<tr>
<td><a href="http://www.msdev.com/Directory/Description.aspx?eventId=1466">4. SQL Server 2008 Express: How do I query data in a database?</a></td>
</tr>
<tr>
<td><a href="http://www.msdev.com/Directory/Description.aspx?eventId=1467" target="_blank">5. SQL Server 2008 Express: How do I update data in a database?</a></td>
</tr>
<tr>
<td><a href="http://www.msdev.com/Directory/Description.aspx?eventId=1468" target="_blank">6. SQL Server 2008 Express: How do I delete data in a database?</a></td>
</tr>
<tr>
<td><a href="http://www.msdev.com/Directory/Description.aspx?eventId=1469" target="_blank">7. SQL Server 2008 Express: How do I join data in a database?</a></td>
</tr>
<tr>
<td><a href="http://www.msdev.com/Directory/Description.aspx?eventId=1470" target="_blank">8. SQL Server 2008 Express: How do I sort, group, etc. queries?</a></td>
</tr>
<tr>
<td><a href="http://www.msdev.com/Directory/Description.aspx?eventId=1471" target="_blank">9. SQL Server 2008 Express: How do I create sub queries?</a></td>
</tr>
<tr>
<td><a href="http://www.msdev.com/Directory/Description.aspx?eventId=1472" target="_blank">10. SQL Server 2008 Express: How do I execute multiple SQL statements in one transaction?</a></td>
</tr>
<tr>
<td><a href="http://www.msdev.com/Directory/Description.aspx?eventId=1474" target="_blank">11. SQL Server 2008 Express: How can I increase the speed of a SQL query (CREATE INDEX)?</a></td>
</tr>
<tr>
<td><a href="http://www.msdev.com/Directory/Description.aspx?eventId=1464" target="_blank">12. SQL Server 2008 Express: SQL Server Express Troubleshooting</a></td>
</tr>
<tr>
<td><a href="http://www.msdev.com/Directory/Description.aspx?eventId=1473" target="_blank">13. SQL Server 2008 Express: How do I secure a SQL Server by assigning dedicated permissions to different users?</a></td>
</tr>
<tr>
<td><a href="http://www.msdev.com/Directory/Description.aspx?eventId=1458" target="_blank">14. SQL Server 2008 Express: How do I backup a SQL Express database?</a></td>
</tr>
<tr>
<td><a href="http://www.msdev.com/Directory/Description.aspx?eventId=1459" target="_blank">15. SQL Server 2008 Express: How do I backup a remote SQL Express database?</a></td>
</tr>
<tr>
<td><a href="http://www.msdev.com/Directory/Description.aspx?eventId=1460" target="_blank">16. SQL Server 2008 Express: How do I restore a SQL Express database?</a></td>
</tr>
<tr>
<td><a href="http://www.msdev.com/Directory/Description.aspx?eventId=1476" target="_blank">17. SQL Server 2008 Express: How do I update a Live SQL Server Database (when the Development Database has changed)?</a></td>
</tr>
<tr>
<td><a href="http://www.msdev.com/Directory/Description.aspx?eventId=1462" target="_blank">18. SQL Server 2008 Express: How do I upsize SQL Server Express 2005 to SQL Server 2008 R2?</a></td>
</tr>
</tbody>
</table>
<p>If you&#8217;re using a paid edition of SQL Server, then you could also consider watching the <a href="http://www.msdev.com/Directory/Description.aspx?eventId=1463" target="_blank">video on integration services</a> and the one on <a href="http://www.msdev.com/Directory/Description.aspx?eventId=1475" target="_blank">profiling queries</a>.</p>
<p>You might know that  I&#8217;m working on a new <a title="Video Series" href="http://learningsqlserver.wordpress.com/video-series/" target="_blank">video series for Learning SQL Server</a>. There will be unique information in this video series, and there will be some overlap with other resources like this. But hopefully, the combination of older and newer video resources, presented in different ways, will aid your overall learning.</p>
<p>For other resources like this, see the post:</p>
<h3><a title="How to Learn SQL Server Online (Advice &amp; Resources)" href="http://learningsqlserver.wordpress.com/2011/02/18/a-new-users-guide-to-learning-sql-server/">How to Learn SQL Server Online (Advice &amp; Resources)</a></h3>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/learningsqlserver.wordpress.com/580/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/learningsqlserver.wordpress.com/580/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/learningsqlserver.wordpress.com/580/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/learningsqlserver.wordpress.com/580/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/learningsqlserver.wordpress.com/580/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/learningsqlserver.wordpress.com/580/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/learningsqlserver.wordpress.com/580/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/learningsqlserver.wordpress.com/580/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/learningsqlserver.wordpress.com/580/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/learningsqlserver.wordpress.com/580/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/learningsqlserver.wordpress.com/580/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/learningsqlserver.wordpress.com/580/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/learningsqlserver.wordpress.com/580/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/learningsqlserver.wordpress.com/580/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=learningsqlserver.wordpress.com&amp;blog=18456007&amp;post=580&amp;subd=learningsqlserver&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://learningsqlserver.wordpress.com/2011/03/09/sql-server-2008-express-how-to-guide-videos/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/8a9fe2d08fee89240904f601e8120016?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">rothja</media:title>
		</media:content>

		<media:content url="http://learningsqlserver.files.wordpress.com/2011/01/mc9004316211.png?w=150" medium="image">
			<media:title type="html">Movie Reel</media:title>
		</media:content>
	</item>
		<item>
		<title>Understanding SQL Server Connection Strings</title>
		<link>http://learningsqlserver.wordpress.com/2011/03/03/understanding-sql-server-connection-strings/</link>
		<comments>http://learningsqlserver.wordpress.com/2011/03/03/understanding-sql-server-connection-strings/#comments</comments>
		<pubDate>Thu, 03 Mar 2011 13:39:47 +0000</pubDate>
		<dc:creator>Jason Roth</dc:creator>
				<category><![CDATA[All]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[ADO.NET]]></category>
		<category><![CDATA[Database]]></category>
		<category><![CDATA[Databases]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[Visual Studio]]></category>

		<guid isPermaLink="false">http://learningsqlserver.wordpress.com/?p=553</guid>
		<description><![CDATA[Many people start learning SQL Server, because they want to use a database in application development. You can develop web or client applications with a retail version of Visual Studio or the free edition, Visual Studio 2010 Express (there is also a new product called Web Matrix that we hope to talk about in future posts). A [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=learningsqlserver.wordpress.com&amp;blog=18456007&amp;post=553&amp;subd=learningsqlserver&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Many people start learning SQL Server, because they want to use a database in application development. You can develop web or client applications with a retail version of Visual Studio or the free edition, <a href="http://www.microsoft.com/express/downloads/" target="_blank">Visual Studio 2010 Express</a> (there is also a new product called <a href="http://www.microsoft.com/web/webmatrix/" target="_blank">Web Matrix</a> that we hope to talk about in future posts). <em>A connection string specifies how to connect to your SQL Server database</em>. Development tools can hide or create this connection string for you, but it helps to know how to create one and what it means. In this post, we&#8217;ll cover the basics, provide some examples, and point to tools that automatically generate connection strings.</p>
<p><span id="more-553"></span></p>
<h3><span style="text-decoration:underline;">Code Example:</span></h3>
<p>Here is some basic ADO.NET code that uses a connection string:</p>
<p><pre class="brush: csharp; gutter: true; highlight: [15]; wrap-lines: false;">
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.SqlClient;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            SqlConnection sqlConn =
                new SqlConnection(@&quot;Data Source=.\SQLEXPRESS;Initial Catalog=AdventureWorksLT;Integrated Security=True&quot;);
            sqlConn.Open();
            SqlCommand cmd = new SqlCommand(&quot;select count(*) from SalesLT.Address&quot;, sqlConn);
            Console.WriteLine(&quot;There are {0} rows in the SalesLT.Address table.&quot;, Convert.ToInt32(cmd.ExecuteScalar()));
        }
    }
}</pre></p>
<p>In this example, the <a href="http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlconnection.aspx" target="_blank">SqlConnection</a> object specifies the connection string in the constructor. The connection string contains a set of properties separated by semicolons. This string specifies that my local SQLEXPRESS instance is the database server, AdventureWorksLT is the database, and my current login should be used to authenticate.</p>
<p>Note that some development tools will present you with a dialog box and create the connection string based on your choices. I&#8217;ll talk more about this at the end of this post.</p>
<h3><span style="text-decoration:underline;">Common Connection Strings</span></h3>
<p>There are a lot of properties you can set on your connection string. However, there are a few common connection strings that I&#8217;d like to describe. To get a full list of properties that you can use, see the documentation for the <a href="http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlconnection.connectionstring.aspx" target="_blank">SqlConnection.ConnectionString Property</a>.</p>
<p>1. The following connection string connects to a database (Initial Catalog) on the database server (Data Source) and uses Windows Authentication (Integrated Security=True), which means the user that runs your application must have access to the target database server and database.</p>
<table>
<tbody>
<tr>
<td>﻿﻿Data Source=.\SQLEXPRESS;Initial Catalog=AdventureWorksLT;Integrated Security=True</td>
</tr>
</tbody>
</table>
<p>2. The following connection string is the same as the first one, except that it does not use Windows Authentication (note that the Integrated Security property is not specified). Instead, it uses SQL Server Authentication, which requires a user name and password. Obviously this opens up a concern about people seeing this information in the code or in a configuration file (see <a href="http://msdn.microsoft.com/en-us/library/ms254494.aspx" target="_blank">Connection Strings and Configuration Files</a>).</p>
<table>
<tbody>
<tr>
<td>Data Source=.\SQLEXPRESS;Initial Catalog=AdventureWorksLT;User ID=myuser;Password=mypassword</td>
</tr>
</tbody>
</table>
<p>3. The following connection string uses a feature called <a href="http://msdn.microsoft.com/en-us/library/ms254504.aspx" target="_blank">User Instances</a>. A user instance opens up a target database file directly in a new instance of SQL Server Express that is running under the context of the current user. This is useful for users that are not administrators on their machines. Note that the database can not also be attached to a running SQL Server instance for this type of connection to succeed, which means you won&#8217;t see this database in a tool like SQL Server Management Studio unless you <a title="How can I open an .MDF file in SQL Server? (Attach Tutorial &amp; Troubleshooting)" href="http://learningsqlserver.wordpress.com/2011/02/13/how-can-i-open-mdf-and-ldf-files-in-sql-server-attach-tutorial-troublshooting/" target="_blank">attach</a> to it.</p>
<table>
<tbody>
<tr>
<td>Data Source=.\SQLEXPRESS;AttachDbFilename=C:\Temp\MyDatabase.mdf;Integrated Security=True;User Instance=True</td>
</tr>
</tbody>
</table>
<h3><span style="text-decoration:underline;">Connection String Tools</span></h3>
<p>There are a few tips for generating connection strings. First, there is a great website that provides examples for many more connection strings than I have given here: <a href="http://www.connectionstrings.com/sql-server-2008" target="_blank">http://www.connectionstrings.com/sql-server-2008</a>.</p>
<p>Second, you can use Visual Studio. If you are working in Microsoft Visual Web Developer 2010, then you should open the <strong>Database Explorer</strong> window. If you&#8217;re working in other editions of Visual Studio, open the <strong>Server Explorer</strong> window. From those panes, you can right-click on the <strong>Data Connections</strong> node and select &#8220;<strong>Add Connection</strong>&#8220;. The wizard guides you through the basic choices. Once you have a connection, you can select it and the <strong>Properties </strong>window shows you the connection string. Here is a screen shot that shows this:</p>
<p><a href="http://learningsqlserver.files.wordpress.com/2011/03/vsserverexplorer.png"><img class="aligncenter size-full wp-image-568" title="Visual Studio Server Explorer" src="http://learningsqlserver.files.wordpress.com/2011/03/vsserverexplorer.png?w=640&#038;h=212" alt="" width="640" height="212" /></a></p>
<p>There are also many other features that Visual Studio can use when you setup connections in this way. Other wizards or properties that require a database connection can use this connection. But here I&#8217;m showing that you can use this technique to quickly get the connection string from the properties window. You can then use that string directly in whatever code you wish.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/learningsqlserver.wordpress.com/553/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/learningsqlserver.wordpress.com/553/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/learningsqlserver.wordpress.com/553/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/learningsqlserver.wordpress.com/553/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/learningsqlserver.wordpress.com/553/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/learningsqlserver.wordpress.com/553/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/learningsqlserver.wordpress.com/553/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/learningsqlserver.wordpress.com/553/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/learningsqlserver.wordpress.com/553/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/learningsqlserver.wordpress.com/553/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/learningsqlserver.wordpress.com/553/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/learningsqlserver.wordpress.com/553/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/learningsqlserver.wordpress.com/553/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/learningsqlserver.wordpress.com/553/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=learningsqlserver.wordpress.com&amp;blog=18456007&amp;post=553&amp;subd=learningsqlserver&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://learningsqlserver.wordpress.com/2011/03/03/understanding-sql-server-connection-strings/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/8a9fe2d08fee89240904f601e8120016?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">rothja</media:title>
		</media:content>

		<media:content url="http://learningsqlserver.files.wordpress.com/2011/03/vsserverexplorer.png" medium="image">
			<media:title type="html">Visual Studio Server Explorer</media:title>
		</media:content>
	</item>
		<item>
		<title>SQL Query Tutorial &amp; Tips (Video)</title>
		<link>http://learningsqlserver.wordpress.com/2011/02/26/sql-query-tutorial-tips-video/</link>
		<comments>http://learningsqlserver.wordpress.com/2011/02/26/sql-query-tutorial-tips-video/#comments</comments>
		<pubDate>Sat, 26 Feb 2011 15:32:42 +0000</pubDate>
		<dc:creator>Jason Roth</dc:creator>
				<category><![CDATA[All]]></category>
		<category><![CDATA[Getting Started]]></category>
		<category><![CDATA[T-SQL]]></category>
		<category><![CDATA[Video Series]]></category>
		<category><![CDATA[Database]]></category>
		<category><![CDATA[Databases]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SQL Server Management Studio]]></category>
		<category><![CDATA[Videos]]></category>

		<guid isPermaLink="false">http://learningsqlserver.wordpress.com/?p=536</guid>
		<description><![CDATA[This next video in the Learning SQL Server video series looks at getting started with Transact-SQL (T-SQL) queries in SQL Server. A query is just a question about your data. T-SQL is just the language used to ask that question. This video looks at basic SELECT queries and then moves on to concepts of aggregations and [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=learningsqlserver.wordpress.com&amp;blog=18456007&amp;post=536&amp;subd=learningsqlserver&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.youtube.com/watch?v=V4hTLja7jU8" target="_blank"><img class="alignleft size-full wp-image-371" title="SQL Query Tutorial Video" src="http://learningsqlserver.files.wordpress.com/2011/02/filmstrip2.png?w=640" alt="SQL Query Tutorial Video"   /></a>This next video in the <a title="Video Series" href="http://learningsqlserver.wordpress.com/video-series/">Learning SQL Server video series</a> looks at getting started with Transact-SQL (T-SQL) queries in SQL Server. A query is just a question about your data. T-SQL is just the language used to ask that question. This video looks at basic SELECT queries and then moves on to concepts of aggregations and joins. In the process, it provides tips working with queries in SQL Server Management Studio (SSMS).</p>
<h2 style="text-align:center;"><strong><a title="SQL Query Tutorial &amp; Tips" href="http://www.youtube.com/watch?v=V4hTLja7jU8" target="_blank">Video: SQL Query Tutorial &amp; Tips</a></strong></h2>
<p><span id="more-536"></span> <span style="text-align:center; display: block;"><a href="http://learningsqlserver.wordpress.com/2011/02/26/sql-query-tutorial-tips-video/"><img src="http://img.youtube.com/vi/V4hTLja7jU8/2.jpg" alt="" /></a></span></p>
<p>Note that this video uses an example database, ExperimentData, that was first introduced in the <a title="Before We Begin: What is a Relational Database?" href="http://learningsqlserver.wordpress.com/2011/01/18/before-we-begin-what-is-a-relational-database/">&#8220;What is a Relational Database?&#8221;</a> video. You can run the queries in this video by running a database script to create this sample database. Copy the script from <a title="ExperimentData Database Script" href="http://learningsqlserver.wordpress.com/video-series/experimentdata-database-script/">this page</a> and run it in a new query window in SQL Server Management Studio. You have to be connected to your database instance and have permissions to create databses. I could have made this a backup file or .MDF file, but the script makes it more likely that anyone can use this simple database, because you could run it in SQL server 2005, 2008, or 2008 R2.</p>
<p>Couple of tips to reiterate from the video:</p>
<ul>
<li>I use F5 to run queries rather than the toolbar. Easy and fast.</li>
<li>Highlight portions of the query window to run just that highlighted section.</li>
<li>For complex queries, add one thing at a time and test each change. This is much easier than trying to write several lines of a complex query all at once.</li>
<li>Take advantage of the documentation. Search for &#8220;Transact-SQL site:msdn.microsoft.com&#8221; and then add the keyword you&#8217;re interested in, such as &#8220;SELECT&#8221;. For example, here are the <a href="http://www.bing.com/search?q=Transact-SQL+site%3Amsdn.microsoft.com+SELECT" target="_blank">bing search results for this example</a>. Note that the examples in the documentation are often the place that help new users the most.</li>
</ul>
<p>For more tips and links, see the &#8220;Transact-SQL&#8221; section of the post: <a title="How to Learn SQL Server Online (Advice &amp; Resources)" href="http://learningsqlserver.wordpress.com/2011/02/18/a-new-users-guide-to-learning-sql-server/">How to Learn SQL Server Online (Advice &amp; Resources)</a>.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/learningsqlserver.wordpress.com/536/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/learningsqlserver.wordpress.com/536/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/learningsqlserver.wordpress.com/536/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/learningsqlserver.wordpress.com/536/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/learningsqlserver.wordpress.com/536/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/learningsqlserver.wordpress.com/536/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/learningsqlserver.wordpress.com/536/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/learningsqlserver.wordpress.com/536/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/learningsqlserver.wordpress.com/536/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/learningsqlserver.wordpress.com/536/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/learningsqlserver.wordpress.com/536/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/learningsqlserver.wordpress.com/536/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/learningsqlserver.wordpress.com/536/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/learningsqlserver.wordpress.com/536/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=learningsqlserver.wordpress.com&amp;blog=18456007&amp;post=536&amp;subd=learningsqlserver&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://learningsqlserver.wordpress.com/2011/02/26/sql-query-tutorial-tips-video/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/8a9fe2d08fee89240904f601e8120016?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">rothja</media:title>
		</media:content>

		<media:content url="http://learningsqlserver.files.wordpress.com/2011/02/filmstrip2.png" medium="image">
			<media:title type="html">SQL Query Tutorial Video</media:title>
		</media:content>
	</item>
		<item>
		<title>How to Learn SQL Server Online (Advice &amp; Resources)</title>
		<link>http://learningsqlserver.wordpress.com/2011/02/18/a-new-users-guide-to-learning-sql-server/</link>
		<comments>http://learningsqlserver.wordpress.com/2011/02/18/a-new-users-guide-to-learning-sql-server/#comments</comments>
		<pubDate>Fri, 18 Feb 2011 12:20:00 +0000</pubDate>
		<dc:creator>Jason Roth</dc:creator>
				<category><![CDATA[All]]></category>
		<category><![CDATA[Getting Started]]></category>
		<category><![CDATA[T-SQL]]></category>
		<category><![CDATA[Database]]></category>
		<category><![CDATA[Databases]]></category>
		<category><![CDATA[Express]]></category>
		<category><![CDATA[Relational Databases]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SQL Server Management Studio]]></category>

		<guid isPermaLink="false">http://learningsqlserver.wordpress.com/?p=292</guid>
		<description><![CDATA[If you&#8217;re new to SQL Server and searching for online training, I&#8217;d just like to say: DON&#8217;T PANIC In this post, I&#8217;d like to provide some tips for how a new SQL Server user can better use online resources with less frustration. SQL Server is a complex product that is meant to serve a variety [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=learningsqlserver.wordpress.com&amp;blog=18456007&amp;post=292&amp;subd=learningsqlserver&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re new to SQL Server and searching for online training, I&#8217;d just like to say:</p>
<p><a href="http://en.wikipedia.org/wiki/Don%27t_Panic_(The_Hitchhiker%27s_Guide_to_the_Galaxy)#Don.27t_Panic" target="_blank">DON&#8217;T PANIC</a></p>
<p>In this post, I&#8217;d like to provide some tips for how a new SQL Server user can better use online resources with less frustration.</p>
<p><span id="more-292"></span>SQL Server is a complex product that is meant to serve a variety of needs, from the smallest application to corporations managing terabytes of data. But this presents two common problems in looking for learning resources online:</p>
<ol>
<li>It&#8217;s hard to know which areas are core SQL Server skills versus a specialized feature.</li>
<li>Many trainings assume a level of knowledge that you may not have yet.</li>
</ol>
<p>Let&#8217;s look at the problem a little closer and then dive into some practical advice.</p>
<h3><span style="text-decoration:underline;">The Challenges:</span></h3>
<p>Let&#8217;s say you&#8217;re just getting started with SQL Server or possibly just learning more about databases. You search for training on SQL Server 2008 R2 and see a tutorial on using &#8221;Master Data Services&#8221;. Although this feature solves a specific business need, it is not part of the core SQL Server knowledge that you need to get started. But how would you know this if you&#8217;re new to SQL Server? You wouldn&#8217;t.</p>
<p>There is another variation on this. Let&#8217;s say you find a video titled, &#8220;Learning SQL Server 2008 R2&#8243;. After congratulating yourself and pressing play on the video window, you find that it covers all of the improvements of 2008 over 2005. This is great if you are using SQL Server 2008 or 2005, but it doesn&#8217;t help you learn core SQL Server skills.</p>
<table>
<tbody>
<tr>
<td><img class="size-full wp-image-420 alignnone" title="Note" src="http://learningsqlserver.files.wordpress.com/2011/02/note.gif?w=640" alt=""   />Note that if you have a <em><strong>requirement </strong></em>to learn a specific area of SQL Server, then you may have to skip straight to that area and do your best. But even then, if you&#8217;re new, it may help to go through the following tips as quickly as possible to give yourself a basic framework. </td>
</tr>
</tbody>
</table>
<h3><span style="text-decoration:underline;">Tip 1: Database Concepts</span></h3>
<p>If you&#8217;re new to databases, the first thing you want to do is to look for topics that cover basic database concepts. SQL Server is a &#8220;Relational Database Management System&#8221; (RDBMS), so you&#8217;ll want to learn relational database concepts. These include understanding concepts like: tables, rows, columns, primary keys, foreign keys, and queries. At this point, stay away from highly-technical articles that tell you how to do it. Also stay away from highly academic articles. Just try to get a feel for the big picture of why databases exist and what are some common characteristics of relational databases. Here are some links that might help:</p>
<ul>
<li><a title="Before We Begin: What is a Relational Database?" href="http://learningsqlserver.wordpress.com/2011/01/18/before-we-begin-what-is-a-relational-database/">Before We Begin: What is a Relational Database?</a></li>
<li><a href="http://www.databasejournal.com/sqletc/article.php/1469521/Introduction-to-Relational-Databases.htm">Introduction to Relational Databases</a> (DatabaseJournal.com)</li>
<li><a href="http://www.asp.net/sql-server/videos/sql-server-2005-express-for-beginners">SQL Server 2005 Express for Beginners Video Series</a></li>
<li><a href="http://www.youtube.com/watch?v=OTkEnRYonW0" target="_blank">Introduction to SQL (Beginning Database Training)</a> (Joes2Pros)</li>
</ul>
<h3><span style="text-decoration:underline;">Tip 2: Install SQL Server</span></h3>
<p>Before you go much further, you should install SQL Server on one of your machines. If you own a copy of SQL Server, such as the Developer Edition, use that. Otherwise, install SQL Server 2008 R2 Express. It&#8217;s free! By installing SQL Server, you can start to go through tutorials or just experiment to speed up your learning. Just note that it may already be installed by other programs. For more information, see the following links:</p>
<ul>
<li><a href="http://www.microsoft.com/express/Database/">Download page for SQL Server 2008 R2 Express</a></li>
<li><a title="What is SQL Server Express?" href="http://learningsqlserver.wordpress.com/2011/01/26/what-is-sql-server-express/">What is SQL Server Express?</a></li>
<li><a title="How to Install SQL Server 2008 R2 Express" href="http://learningsqlserver.wordpress.com/2011/01/24/how-to-install-sql-server-2008-r2-express/">How to Install SQL Server 2008 R2 Express</a></li>
<li><a href="http://msdn.microsoft.com/en-us/library/bb500469.aspx" target="_blank">SQL Server 2008 R2 Installation</a> (MSDN)</li>
</ul>
<h3><span style="text-decoration:underline;">Tip 3: Start with the Database Engine</span></h3>
<p>I don&#8217;t mean that you should only search for topics about the SQL Server D<a href="http://msdn.microsoft.com/en-us/library/ms187875.aspx" target="_blank"><img class="alignright size-full wp-image-488" title="SQL Server Areas" src="http://learningsqlserver.files.wordpress.com/2011/02/sqlfeaturematrix.gif?w=640" alt="SQL Server Areas"   /></a>atabase Engine, although you could benefit from knowing where this <a href="http://msdn.microsoft.com/en-us/library/ms187875.aspx" target="_blank">documentation lives</a>. Instead, I&#8217;m pointing out that there are several major components of SQL Server. I&#8217;ve copied a graphic out of the documentation to illustrate this.</p>
<p>Here&#8217;s the thing: it&#8217;s going to be hard to work with Reporting Services without data to report on. And you can&#8217;t perform Analysis Services without data to analyze. Plus, if you&#8217;re using <a title="What is SQL Server Express?" href="http://learningsqlserver.wordpress.com/2011/01/26/what-is-sql-server-express/">Express</a>, you don&#8217;t even have access to some of these components.</p>
<p>Focusing on the database engine means looking for training on using SQL Server to perform tasks like creating databases, tables, views, and stored procedures. It also involves learning Transact-SQL queries to read and change data as well as to script database management tasks. My advice is to learn to do things first in SQL Server Management Studio, which is my next tip. </p>
<p>SQL Server has a lot of components that you&#8217;ll want to learn about later. Just don&#8217;t let those features distract you from your initial goal of learning core database skills. For suggested links, see the next tip.</p>
<h3><span style="text-decoration:underline;">Tip 4: SQL Server Management Studio</span></h3>
<p>Have you ever installed a product, looked in the Start Menu, and<img class="alignright size-full wp-image-166" title="SQL Server 2008 R2 Menu Item" src="http://learningsqlserver.files.wordpress.com/2010/12/sqlserver2008r2menuitem.png?w=640" alt="SQL Server 2008 R2 Menu Item"   /> found that it installed several programs? SQL Server is like that, and you may wonder which one to launch. The easiest way to begin learning is through <a title="SQL Server Management Studio (SSMS) Basics" href="http://learningsqlserver.wordpress.com/2011/02/04/sql-server-management-studio-ssms-basics/">SQL Server Management Studio (SSMS)</a>. You can gain a lot of database management skills by using this UI. Then, when it&#8217;s called for, you can learn to script out more work using Transact-SQL, which I&#8217;ll cover next.</p>
<p>Here are some helpful links to help you get started with SQL Server Management Studio:</p>
<ul>
<li><a title="So You’ve Installed SQL Server…Now What?" href="http://learningsqlserver.wordpress.com/2011/02/07/so-youve-installed-sql-server-now-what/" target="_blank">Getting Started Video</a></li>
<li><a href="http://msdn.microsoft.com/en-us/library/ms174173.aspx" target="_blank">SQL Server Management Studio</a> (MSDN)</li>
<li><a title="SQL Server Management Studio (SSMS) Basics" href="http://learningsqlserver.wordpress.com/2011/02/04/sql-server-management-studio-ssms-basics/" target="_blank">SSMS Basics</a></li>
<li><a href="http://technet.microsoft.com/en-us/library/cc966390.aspx" target="_blank">SSMS Tutorial </a>(Technet)</li>
<li><a href="http://msdn.microsoft.com/en-us/library/ms345318(SQL.100).aspx" target="_blank">Getting Started with the Database Engine</a> (MSDN)</li>
<li><a href="http://www.quackit.com/sql_server/sql_server_2008/tutorial/create_a_table.cfm" target="_blank">SQL Server 2008 Tutorial </a>(Quackit.com)</li>
<li><a href="http://www.msdev.com/Directory/SeriesDescription.aspx?CourseId=124" target="_blank">SQL Server 2008 Express How-to-Guide Video Series</a> (MsDev.com)</li>
<li><a title="SQL Server Express for Beginners Video Series" href="http://learningsqlserver.wordpress.com/2011/01/31/sql-server-2005-express-for-beginners-video-series/" target="_blank">SQL Server 2005 Express for Beginners Video Series</a></li>
<li><a href="http://social.technet.microsoft.com/wiki/contents/articles/how-to-design-create-and-maintain-a-sql-server-database.aspx" target="_blank">How to Design, Create, and Maintain a SQL Server Database</a> (Technet Wiki)</li>
</ul>
<h3><span style="text-decoration:underline;">Tip 5: Transact-SQL (T-SQL)</span></h3>
<p>Transact-SQL (T-SQL) is a &#8220;structured query language&#8221; for working with the data in your database. With the UI of SSMS and the power of development tools, you can actually go a while without knowing T-SQL. But eventually, you need to learn it. I personally think it&#8217;s really fun (like a word puzzle for how to get the data you want).</p>
<p>Here is a classic example of a T-SQL query to return all of the data from a table:</p>
<table>
<tbody>
<tr>
<td>SELECT * FROM MyTable</td>
</tr>
</tbody>
</table>
<p>You can run these queries in SQL Server Management Studio in a &#8220;New Query&#8221; window. There is an Execute button on the toolbar, or you can just push F5. Almost anything you can do through SSMS, you can do in T-SQL commands. And you can far exceed the capabilities of any UI with the power of queries and scripts. Plus, if you do development, there may be times when you have to understand T-SQL in order to write your code (although development tools try to hide this from you).</p>
<p>One of my favorite tips for learning T-SQL is to use two SSMS features. The first one is to right-click on tables in SSMS and select &#8220;Script Table as&#8221;. The submenus give you the choice to create many different types of scripts. Here is a screenshot:</p>
<p><img class="aligncenter size-full wp-image-499" title="SQLServerScriptAsMenus" src="http://learningsqlserver.files.wordpress.com/2011/02/sqlserverscriptasmenus.png?w=640&#038;h=344" alt="SQL Server Script As Menus" width="640" height="344" /></p>
<p>So if you selected &#8220;INSERT To&#8221;, you&#8217;d see one example of how to insert rows (you&#8217;d have to replace some of the placeholders with actual values to get it to work though). Then you could look up the INSERT command in the MSDN Library to learn more options. Another SSMS feature like this involves a Script button that you&#8217;ll find at the top of some windows. For example, here is what happens when I click the down arrow next to the Script button on the &#8220;New Database&#8221; dialog:</p>
<p><img class="aligncenter size-full wp-image-502" title="SQLServerScriptButton" src="http://learningsqlserver.files.wordpress.com/2011/02/sqlserverscriptbutton1.png?w=640&#038;h=220" alt="SQL Server Script Options" width="640" height="220" /></p>
<p>If I select &#8220;Script Action to New Query Window&#8221;, then a new query window is opened with the T-SQL commands necessary to perform that actions that I&#8217;m about to take in the dialog. This can help you to quickly answer the question of &#8220;How do I do that in a T-SQL script?&#8221;</p>
<p>T-SQL is a big subject, but if you&#8217;re going to use SQL Server, it pays to invest some time with it. Here are some links to more information:</p>
<ul>
<li><a href="http://msdn.microsoft.com/en-us/library/bb510741.aspx" target="_blank">Transact-SQL Reference </a>(MSDN)</li>
<li><a href="http://msdn.microsoft.com/en-us/library/ms365303.aspx" target="_blank">Transact-SQL Tutorial</a> (MSDN)</li>
<li><a href="http://msdn.microsoft.com/en-us/library/bb264565(SQL.90).aspx" target="_blank">Writing SQL Queries: Let&#8217;s Start with the Basics </a>(MSDN)</li>
<li><a href="http://www.youtube.com/watch?v=Rpp28U_K9Lk" target="_blank">Video: SQL Server Query Tutorial</a> (Joes2Pros)</li>
</ul>
<h3><span style="text-decoration:underline;">Tip 6: Everything Else&#8230;</span></h3>
<p>I could have easily kept adding tips until this post became a full-blown book or learning plan for all of SQL Server. But that defeats the purpose. My hope is that this post has helped you to get started, to use SSMS, to create databases, to write queries. Now you should have a framework for going off and learning <a href="http://msdn.microsoft.com/en-us/library/ms130214.aspx" target="_blank">many other things</a>: Analysis Services, Reporting Service, Integration Services, Development, etc.</p>
<p>A few parting tips:</p>
<ol>
<li>If you want to learn features of the paid editions (like Analysis Services) without going broke, purchase an inexpensive copy of the Developer edition. You can&#8217;t use it in production, but you can test and develop against it. And it has all of the features of the DataCenter edition. For more information, see <a href="http://www.microsoft.com/sqlserver/en/us/editions.aspx" target="_blank">this page</a>.</li>
<li>Bookmark the <a href="http://msdn.microsoft.com/en-us/sqlserver/default.aspx" target="_blank">SQL Server Developer Center</a>. This place has tons of resources and is regularly updated.</li>
<li>If want to create applications that use SQL Server, you have a lot of choices. For resources, check out the <a href="http://msdn.microsoft.com/en-us/data/default.aspx" target="_blank">Data Development Center</a> and the wiki post <a href="http://social.technet.microsoft.com/wiki/contents/articles/introduction-to-development-with-sql-server.aspx" target="_blank">Introduction to Development with SQL Server</a>. Note that my post is really focussed on the database itself. Getting started with database development is beyond the scope (but will hopefully be addressed on this blog in the future).</li>
</ol>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/learningsqlserver.wordpress.com/292/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/learningsqlserver.wordpress.com/292/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/learningsqlserver.wordpress.com/292/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/learningsqlserver.wordpress.com/292/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/learningsqlserver.wordpress.com/292/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/learningsqlserver.wordpress.com/292/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/learningsqlserver.wordpress.com/292/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/learningsqlserver.wordpress.com/292/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/learningsqlserver.wordpress.com/292/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/learningsqlserver.wordpress.com/292/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/learningsqlserver.wordpress.com/292/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/learningsqlserver.wordpress.com/292/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/learningsqlserver.wordpress.com/292/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/learningsqlserver.wordpress.com/292/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=learningsqlserver.wordpress.com&amp;blog=18456007&amp;post=292&amp;subd=learningsqlserver&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://learningsqlserver.wordpress.com/2011/02/18/a-new-users-guide-to-learning-sql-server/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/8a9fe2d08fee89240904f601e8120016?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">rothja</media:title>
		</media:content>

		<media:content url="http://learningsqlserver.files.wordpress.com/2011/02/note.gif" medium="image">
			<media:title type="html">Note</media:title>
		</media:content>

		<media:content url="http://learningsqlserver.files.wordpress.com/2011/02/sqlfeaturematrix.gif" medium="image">
			<media:title type="html">SQL Server Areas</media:title>
		</media:content>

		<media:content url="http://learningsqlserver.files.wordpress.com/2010/12/sqlserver2008r2menuitem.png" medium="image">
			<media:title type="html">SQL Server 2008 R2 Menu Item</media:title>
		</media:content>

		<media:content url="http://learningsqlserver.files.wordpress.com/2011/02/sqlserverscriptasmenus.png" medium="image">
			<media:title type="html">SQLServerScriptAsMenus</media:title>
		</media:content>

		<media:content url="http://learningsqlserver.files.wordpress.com/2011/02/sqlserverscriptbutton1.png" medium="image">
			<media:title type="html">SQLServerScriptButton</media:title>
		</media:content>
	</item>
		<item>
		<title>How can I open an .MDF file in SQL Server? (Attach Tutorial &amp; Troubleshooting)</title>
		<link>http://learningsqlserver.wordpress.com/2011/02/13/how-can-i-open-mdf-and-ldf-files-in-sql-server-attach-tutorial-troublshooting/</link>
		<comments>http://learningsqlserver.wordpress.com/2011/02/13/how-can-i-open-mdf-and-ldf-files-in-sql-server-attach-tutorial-troublshooting/#comments</comments>
		<pubDate>Sun, 13 Feb 2011 11:00:01 +0000</pubDate>
		<dc:creator>Jason Roth</dc:creator>
				<category><![CDATA[All]]></category>
		<category><![CDATA[Management]]></category>
		<category><![CDATA[Administration]]></category>
		<category><![CDATA[Database]]></category>
		<category><![CDATA[Databases]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SQL Server Management Studio]]></category>
		<category><![CDATA[Troubleshooting]]></category>
		<category><![CDATA[Versions]]></category>

		<guid isPermaLink="false">http://learningsqlserver.wordpress.com/?p=404</guid>
		<description><![CDATA[Let&#8217;s say someone wants to give you their SQL Server database. Maybe they want you to manage it, troubleshoot it, or learn from it. So they hand you a .MDF file and  .LDF file and tell you that you need SQL server 2008 R2 to open them. So you install SQL Server 2008 R2 Express [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=learningsqlserver.wordpress.com&amp;blog=18456007&amp;post=404&amp;subd=learningsqlserver&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Let&#8217;s say someone wants to give you their SQL Server database. Maybe they want you to manage it, troubleshoot it, or learn from it. So they hand you a .MDF file and  .LDF file and tell you that you need SQL server 2008 R2 to open them. So you<a title="How to Install SQL Server 2008 R2 Express" href="http://learningsqlserver.wordpress.com/2011/01/24/how-to-install-sql-server-2008-r2-express/"> install SQL Server 2008 R2 Express </a>(which, to your relief, is free). You open <a title="SQL Server Management Studio (SSMS) Basics" href="http://learningsqlserver.wordpress.com/2011/02/04/sql-server-management-studio-ssms-basics/">SQL Server Management Studio</a>(SSMS), and you try to open the .MDF file. You get the following error:</p>
<p><span id="more-404"></span></p>
<div id="attachment_410" class="wp-caption aligncenter" style="width: 482px"><img class="size-full wp-image-410  " title="Attach1_NoEditorError" src="http://learningsqlserver.files.wordpress.com/2011/02/attachpost1.png?w=640" alt="There is no editor available for 'C:\Temp\MyDatabase.mdf'. Make sure the application for file type (.mdf) is installed."   /><p class="wp-caption-text">There is no editor available for &#039;C:\Temp\MyDatabase.mdf&#039;. Make sure the application for file type (.mdf) is installed.</p></div>
<h3><span style="text-decoration:underline;">The Solution:</span></h3>
<p>.MDF files are SQL Server database files and .LDF files are the associated log files. But you can&#8217;t really &#8220;open&#8221; them. Instead, you have to &#8220;attach&#8221; to them. Once you attach, you&#8217;ll see the database in the object explorer of SSMS.</p>
<table>
<tbody>
<tr>
<td><img class="size-full wp-image-420 alignnone" title="Note" src="http://learningsqlserver.files.wordpress.com/2011/02/note.gif?w=640" alt=""   />If you&#8217;re thinking, &#8220;Why wasn&#8217;t the <a href="http://msdn.microsoft.com/en-us/library/ms187048.aspx" target="_blank">Backup and Restore</a> process used instead of passing around these database files?&#8221; It&#8217;s a valid question, but it doesn&#8217;t help the reader staring at .MDF and .LDF files with no clue how to access them. However, if you need to move a database around, you should do a search on &#8220;backup restore attach detach sql server&#8221; (without the quotes) in your favorite search engine. You&#8217;ll get lots of opinions to help you decide the best approach.</td>
</tr>
</tbody>
</table>
<h3><span style="text-decoration:underline;">How to Attach in a Perfect World:</span></h3>
<div id="attachment_432" class="wp-caption alignright" style="width: 250px"><a href="http://www.youtube.com/watch?v=rhIr9Qf-oHw" target="_blank"><img class="size-full wp-image-432    " title="AttachPost_Right_Click" src="http://learningsqlserver.files.wordpress.com/2011/02/attachpost2b.png?w=640" alt="Click here to watch a video on this..."   /></a><p class="wp-caption-text">Click here to watch a video on this...</p></div>
<p>There&#8217;s a couple of different methods. I&#8217;ll give you the &#8220;easy&#8221; way through SQL Server Management Studio (SSMS) and then point you to other methods using T-SQL queries.</p>
<ol>
<li>Launch SSMS.</li>
<li>Connect to your <a title="Find your Installed SQL Server Versions and Instances" href="http://learningsqlserver.wordpress.com/2011/01/21/what-version-of-sql-server-do-i-have/" target="_blank">SQL Server Instance</a>.</li>
<li>Right-click on <strong>Databases </strong>in the Object Explorer.</li>
<li>Click <strong>Attach</strong>.</li>
<li>In the <strong>Attach Databases </strong>window, click the <strong>Add </strong>button.</li>
<li>Navigate to the directory containing the .MDF and .LDF files.</li>
<li>Select the .MDF file, and press <strong>OK</strong>.</li>
<li>Press <strong>OK </strong>again to attach the database.</li>
</ol>
<p>You should see the database appear in the Databases node (press F5 if you don&#8217;t). You can now explore the data using SSMS. These same steps are documented in the MSDN <a href="http://msdn.microsoft.com/en-us/library/ms190209.aspx" target="_blank">here</a>. I&#8217;m just summarizing to make it easier for you.</p>
<p>There are two ways to accomplish the same thing in a T-SQL script. First, you can use the <a href="http://msdn.microsoft.com/en-us/library/ms179877.aspx" target="_blank">sp_attach_db</a> stored procedure. This is shown <a href="http://support.microsoft.com/kb/224071" target="_blank">here</a>. Or you can use the <a href="http://msdn.microsoft.com/en-us/library/ms176061.aspx" target="_blank">CREATE DATABASE</a> command with the FOR ATTACH argument.</p>
<h3><span style="text-decoration:underline;">So, the World isn&#8217;t Perfect</span></h3>
<p>If your database is successfully attached, then stop reading and go use it. But if you see any errors or unexpected behaviors, I&#8217;ll try to share some troubleshooting suggestions.</p>
<p>First, you may get a generic error like the following..</p>
<div id="attachment_436" class="wp-caption aligncenter" style="width: 625px"><img class="size-full wp-image-436   " title="AttachPost_SomethingWentWrong" src="http://learningsqlserver.files.wordpress.com/2011/02/attachpost6.png?w=640" alt="An error occurred when attaching the database(s). Click the hyperlink in the Message column for details."   /><p class="wp-caption-text">An error occurred when attaching the database(s). Click the hyperlink in the Message column for details.</p></div>
<p>You might be asking, &#8220;Where&#8217;s the hyperlink?&#8221; I&#8217;ll show you in the next screenshot (circled in red), and it will also be our first example.</p>
<h4><span style="text-decoration:underline;">1. Access Denied:</span></h4>
<div class="mceTemp mceIEcenter" style="text-align:left;">
<dl class="wp-caption aligncenter">
<dt class="wp-caption-dt"><img class="size-full wp-image-437   " title="AttachPost_Access_Denied" src="http://learningsqlserver.files.wordpress.com/2011/02/attachpost7.png?w=640" alt="Attach database failed for Server ###. (Microsoft.SqlServer.Smo) Unable to open the physical file &quot;####&quot;. Operating system error 5: &quot;5(Access is denied.)&quot;. (Microsoft SQL Server, Error 5120)"   /></dt>
<dd class="wp-caption-dd">Attach database failed for Server ###. (Microsoft.SqlServer.Smo) Unable to open the physical file &#8220;####&#8221;. Operating system error 5: &#8220;5(Access is denied.)&#8221;. (Microsoft SQL Server, Error 5120)</dd>
</dl>
</div>
<p>This access denied error could have a few different causes. Basically, you don&#8217;t have the required access to the .MDF or .LDF files. This can happen if you get the file from someone else. When they detach the database file, the file permissions are changed to give only that user full control. Also, even if you see that the file has full control for the Administrators group, it may not be enough. Remember in Windows 7/Vista, those permissions are often only realized when you&#8217;re running an application as an Administrator.</p>
<p>So here are several choices to fix it:</p>
<ol>
<li>The easiest solution is to close SSMS and then <a href="http://windows.microsoft.com/en-US/windows7/How-do-I-run-an-application-once-with-a-full-administrator-access-token" target="_blank">run it as an Administrator</a>. Perform the attach as an Administrator, and it&#8217;s likely going to work.</li>
<li>Another solution is to explicitly grant full control to the .MDF and .LDF files to your user account. This can be done by right-clicking the files, selecting Properties, and modifying the Security tab.</li>
<li>A final solution is to copy the files to the default directory for your other database files. To find out what that is, you can use the <a href="http://msdn.microsoft.com/en-us/library/ms174307.aspx" target="_blank">sp_helpfile</a> procedure in SSMS. On my machine it is: C:\Program Files\Microsoft SQL Server\MSSQL10_50.SQLEXPRESS\MSSQL\DATA. By copying the files to this directory, they automatically get permissions applied that will allow the attach to succeed.</li>
</ol>
<h4><span style="text-decoration:underline;">2. Access Denied Variation 2</span></h4>
<p>There is another variation of the Access Denied message that has a simple solution:</p>
<div id="attachment_438" class="wp-caption aligncenter" style="width: 622px"><img class="size-full wp-image-438 " title="AttachPost_SelectingExistingFile" src="http://learningsqlserver.files.wordpress.com/2011/02/attachpost8_after_selecting_file_you_didnt_detach.png?w=640" alt="Failed to retrieve data for this request. (Microsoft.SqlServer.Management.Sdk.Sfc) CREATE FILE encountered operating system error 5(Access is denied.) while attempting to open or create the physical file '####'. (Microsoft SQL Server, Error: 5123)"   /><p class="wp-caption-text">Failed to retrieve data for this request. (Microsoft.SqlServer.Management.Sdk.Sfc) CREATE FILE encountered operating system error 5(Access is denied.) while attempting to open or create the physical file &#039;####&#039;. (Microsoft SQL Server, Error: 5123)</p></div>
<p style="text-align:left;">This error means that the file is already opened exclusively by another application. The most likely cause is that this database file is already attached to an instance of SQL Server. Double-check your list of databases to see whether it is already in the list. It&#8217;s also possible for applications to use .MDF files directly with a feature called <a href="http://msdn.microsoft.com/en-us/library/ms254504.aspx">User Instances</a>. If an application is using a .MDF file in this way, then it would have to close before you could attach the to that database file.</p>
<h4 style="text-align:left;"><span style="text-decoration:underline;">3. Database is Read-only</span></h4>
<p style="text-align:left;">This is not so much an error as an undesired result. When you load the database, it is in a read-only state. You can tell by the gray shading of the databasee icon (not to mention the &#8220;Read-Only&#8221; label next to it).</p>
<p style="text-align:center;"><img class="size-full wp-image-441 aligncenter" title="AttachPost_admindrive_readonly" src="http://learningsqlserver.files.wordpress.com/2011/02/attachpost11_both_admin_drive_and_readonly.png?w=640" alt=""   /></p>
<p>The most probable cause is that the .MDF file you attached to is read-only. Just right-click on the .MDF and .LDF files, select properties, and then uncheck the Read-only check box.</p>
<p style="text-align:center;"><img class="size-full wp-image-442 aligncenter" title="AttachPost_UmarkingReadonly" src="http://learningsqlserver.files.wordpress.com/2011/02/attachpost12.png?w=640" alt=""   /></p>
<h4 style="text-align:left;"><span style="text-decoration:underline;">4. Unable to Downgrade</span></h4>
<p style="text-align:left;">The next error happens when you try to attach a database of a higher version of SQL Server (like SQL Server 2008 R2) to a SQL Server Instance of a lower version (like SQL Server 2005).</p>
<div id="attachment_440" class="wp-caption aligncenter" style="width: 624px"><img class="size-full wp-image-440 " title="AttachPost_AnotherError" src="http://learningsqlserver.files.wordpress.com/2011/02/attachpost10.png?w=640" alt="Attach database failed for Server '####'. (Microsoft.SqlServer.Smo) An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo) The database '####' cannot be opened because it is version 661. This server supports version 655 and earlier. A downgrade path is not supported. Could not open a new database '####'. CREATE DATABASE is aborted. (Microsoft SQL Server, Error: 948)"   /><p class="wp-caption-text">Attach database failed for Server &#039;####&#039;. (Microsoft.SqlServer.Smo) An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo) The database &#039;####&#039; cannot be opened because it is version 661. This server supports version 655 and earlier. A downgrade path is not supported. Could not open a new database &#039;####&#039;. CREATE DATABASE is aborted. (Microsoft SQL Server, Error: 948)</p></div>
<p>This has never been supported. You can attach a database of an older version of SQL Server to a newer version, but you can&#8217;t go the other direction. If you want to verify the version of SQL Server you&#8217;re running, see <a title="Find your Installed SQL Server Versions and Instances" href="http://learningsqlserver.wordpress.com/2011/01/21/what-version-of-sql-server-do-i-have/">this post</a>.</p>
<h3><span style="text-decoration:underline;">A Parting Word on Detach:</span></h3>
<p>This post is just covering the scenarios of, &#8220;How do I open this .MDF file&#8221; and &#8220;Oh, I have to attach it, why am I getting errors?&#8221;. But how were these files obtained in the first place? The answer is that there is a corresponding Detach feature in SQL Server. You can find it by right-clicking on the database in SSMS, selecting tasks, and looking for Detach. Before you do this, though, run the sp_helpfile procedure in a query window in the context of your database. This will tell you *where* the detached .MDF file will be located. After you&#8217;ve detached the file, you can attach it to any SQL Server instance. Although this post was about Attach, I think it&#8217;s worth mentioning this for completeness.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/learningsqlserver.wordpress.com/404/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/learningsqlserver.wordpress.com/404/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/learningsqlserver.wordpress.com/404/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/learningsqlserver.wordpress.com/404/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/learningsqlserver.wordpress.com/404/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/learningsqlserver.wordpress.com/404/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/learningsqlserver.wordpress.com/404/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/learningsqlserver.wordpress.com/404/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/learningsqlserver.wordpress.com/404/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/learningsqlserver.wordpress.com/404/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/learningsqlserver.wordpress.com/404/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/learningsqlserver.wordpress.com/404/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/learningsqlserver.wordpress.com/404/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/learningsqlserver.wordpress.com/404/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=learningsqlserver.wordpress.com&amp;blog=18456007&amp;post=404&amp;subd=learningsqlserver&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://learningsqlserver.wordpress.com/2011/02/13/how-can-i-open-mdf-and-ldf-files-in-sql-server-attach-tutorial-troublshooting/feed/</wfw:commentRss>
		<slash:comments>23</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/8a9fe2d08fee89240904f601e8120016?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">rothja</media:title>
		</media:content>

		<media:content url="http://learningsqlserver.files.wordpress.com/2011/02/attachpost1.png" medium="image">
			<media:title type="html">Attach1_NoEditorError</media:title>
		</media:content>

		<media:content url="http://learningsqlserver.files.wordpress.com/2011/02/note.gif" medium="image">
			<media:title type="html">Note</media:title>
		</media:content>

		<media:content url="http://learningsqlserver.files.wordpress.com/2011/02/attachpost2b.png" medium="image">
			<media:title type="html">AttachPost_Right_Click</media:title>
		</media:content>

		<media:content url="http://learningsqlserver.files.wordpress.com/2011/02/attachpost6.png" medium="image">
			<media:title type="html">AttachPost_SomethingWentWrong</media:title>
		</media:content>

		<media:content url="http://learningsqlserver.files.wordpress.com/2011/02/attachpost7.png" medium="image">
			<media:title type="html">AttachPost_Access_Denied</media:title>
		</media:content>

		<media:content url="http://learningsqlserver.files.wordpress.com/2011/02/attachpost8_after_selecting_file_you_didnt_detach.png" medium="image">
			<media:title type="html">AttachPost_SelectingExistingFile</media:title>
		</media:content>

		<media:content url="http://learningsqlserver.files.wordpress.com/2011/02/attachpost11_both_admin_drive_and_readonly.png" medium="image">
			<media:title type="html">AttachPost_admindrive_readonly</media:title>
		</media:content>

		<media:content url="http://learningsqlserver.files.wordpress.com/2011/02/attachpost12.png" medium="image">
			<media:title type="html">AttachPost_UmarkingReadonly</media:title>
		</media:content>

		<media:content url="http://learningsqlserver.files.wordpress.com/2011/02/attachpost10.png" medium="image">
			<media:title type="html">AttachPost_AnotherError</media:title>
		</media:content>
	</item>
		<item>
		<title>So You&#8217;ve Installed SQL Server&#8230;Now What?</title>
		<link>http://learningsqlserver.wordpress.com/2011/02/07/so-youve-installed-sql-server-now-what/</link>
		<comments>http://learningsqlserver.wordpress.com/2011/02/07/so-youve-installed-sql-server-now-what/#comments</comments>
		<pubDate>Tue, 08 Feb 2011 02:31:35 +0000</pubDate>
		<dc:creator>Jason Roth</dc:creator>
				<category><![CDATA[All]]></category>
		<category><![CDATA[Getting Started]]></category>
		<category><![CDATA[Management]]></category>
		<category><![CDATA[Video Series]]></category>
		<category><![CDATA[AdventureWorks]]></category>
		<category><![CDATA[Database]]></category>
		<category><![CDATA[Databases]]></category>
		<category><![CDATA[Excel]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SQL Server Management Studio]]></category>
		<category><![CDATA[Videos]]></category>

		<guid isPermaLink="false">http://learningsqlserver.wordpress.com/?p=384</guid>
		<description><![CDATA[After the satisfaction of successfully installing SQL Server, you close the setup dialog. But if you&#8217;re new to SQL Server, it&#8217;s not obvious how to continue. If you&#8217;re like me, you look at the Start Menu for new items. But it&#8217;s much easier if you have a friend or coworker that can just show you [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=learningsqlserver.wordpress.com&amp;blog=18456007&amp;post=384&amp;subd=learningsqlserver&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.youtube.com/watch?v=9_3qgAxplW0" target="_blank"><img class="alignleft size-full wp-image-371" title="Getting Started with SQL Server Video" src="http://learningsqlserver.files.wordpress.com/2011/02/filmstrip2.png?w=640" alt="Getting Started with SQL Server Video"   /></a>After the satisfaction of <a title="How to Install SQL Server 2008 R2 Express" href="http://learningsqlserver.wordpress.com/2011/01/24/how-to-install-sql-server-2008-r2-express/" target="_blank">successfully installing SQL Server</a>, you close the setup dialog. But if you&#8217;re new to SQL Server, it&#8217;s not obvious how to continue. If you&#8217;re like me, you look at the Start Menu for new items. But it&#8217;s much easier if you have a friend or coworker that can just show you a few ways to get started. Then your experimentation is a lot less random and more productive. That&#8217;s the goal of the latest video in the &#8220;Learning SQL Server&#8221; video series:</p>
<h2 style="text-align:center;"><strong><a title="Getting Started with SQL Server 2008" href="http://www.youtube.com/watch?v=9_3qgAxplW0" target="_blank">Video: Getting Started with SQL Server 2008<br />
</a></strong></h2>
<p><span id="more-384"></span> <span style="text-align:center; display: block;"><a href="http://learningsqlserver.wordpress.com/2011/02/07/so-youve-installed-sql-server-now-what/"><img src="http://img.youtube.com/vi/9_3qgAxplW0/2.jpg" alt="" /></a></span></p>
<p>This video shows three easy ways to quickly start working with databases in SQL Server:</p>
<ul>
<li>Using SQL Server Management Studio (SSMS), it shows you how to create a database, create a table, and then insert rows into the table.</li>
<li>It provides the <a href="http://msftdbprodsamples.codeplex.com/" target="_blank">download location for the AdventureWorks</a> sample databases and shows you how to view the installed database(s).</li>
<li>It shows how to import Excel data into a SQL Server database.</li>
</ul>
<p>In eight minutes, no training can turn you into an expert. But hopefully seeing these examples encourages you to boldly experiment and learn. And then you have some context for the mass of other trainings out there.</p>
<p>Of course, this is one of many getting started tutorials for SQL Server. I&#8217;d like to recommend the various links on the <a title="Resources" href="http://learningsqlserver.wordpress.com/resources/" target="_blank">Resources Page</a> of this blog. You can also find other excellent videos on the subject. I&#8217;ve already recommended the <a title="SQL Server Express for Beginners Video Series" href="http://learningsqlserver.wordpress.com/2011/01/31/sql-server-2005-express-for-beginners-video-series/" target="_blank">SQL Server Express for Beginners</a> series. And there are also many other community resources, such as the <a href="http://www.youtube.com/user/Joes2Pros" target="_blank">Joes2Pros YouTube channel</a>.</p>
<h3><span style="text-decoration:underline;">Note to 64-bit Excel 2010 Users:</span></h3>
<p>In the video, it shows some very simple steps to importing Excel data into SQL Server 2008 R2 Express. But if you have the 64-bit version of Office 2010 installed, you may run into the following error when attempting to import a XLSX spreadsheet workbook:</p>
<div class="mceTemp mceIEcenter" style="text-align:left;">
<dl class="wp-caption aligncenter">
<dt class="wp-caption-dt"><img class="size-full wp-image-393" title="Excel Import Error" src="http://learningsqlserver.files.wordpress.com/2011/02/excelimporterror1.png?w=640" alt="The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine. (System.Data)"   /></dt>
<dd class="wp-caption-dd">The &#8216;Microsoft.ACE.OLEDB.12.0&#8242; provider is not registered on the local machine.</dd>
</dl>
<p>The basic cause of this problem is that this importer is looking for the 32-bit driver for reading the excel data, and, instead, the machine has the 64-bit driver. There are a few work-arounds that would have complicated the video to share. Here they are:</p>
</div>
<ul>
<li>
<div class="mceTemp mceIEcenter" style="text-align:left;">In my own tests, I noticed that I could successfully import an Excel 2003 (.XLS) file on a machine with 64bit SQL Server and 64bit Office 2010.</div>
</li>
<li>
<div class="mceTemp mceIEcenter" style="text-align:left;">I also found that although I could not import an Excel 2007 (.XLSX) file on that machine, I could import the Excel 2007 (.XLSX) file using the Excel 2003 version selection in the Import wizard. I&#8217;m not exactly sure why this worked, so I wouldn&#8217;t count on it.</div>
</li>
<li>
<div class="mceTemp mceIEcenter" style="text-align:left;">You can always uninstall the 64-bit version of Office and then install the 32-bit version. But this, I know, is a pain.</div>
</li>
<li>
<div class="mceTemp mceIEcenter" style="text-align:left;">You can save your Excel files as CSV files. Then you can use the &#8220;Flat File Source&#8221; Data source in the import wizard.</div>
</li>
<li>
<div class="mceTemp mceIEcenter" style="text-align:left;">Finally, there are some more sophisticated work-arounds documented on other sites. Rather than reinventing the wheel, here is one post that I found with other options: <a href="http://hrvoje.piasevoli.com/2010/09/01/importing-data-from-64-bit-excel-in-ssis/">http://hrvoje.piasevoli.com/2010/09/01/importing-data-from-64-bit-excel-in-ssis/</a>. I haven&#8217;t had a chance to try it yet.</div>
</li>
</ul>
<p class="mceTemp mceIEcenter" style="text-align:left;">It&#8217;s a shame to spend so much time in this post talking about an exception. But there is nothing worse than seeing something work in a video and then have it fail for you when you try it. Eventually, I&#8217;ll probably break this information out into its own post. But for now, it can live here.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/learningsqlserver.wordpress.com/384/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/learningsqlserver.wordpress.com/384/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/learningsqlserver.wordpress.com/384/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/learningsqlserver.wordpress.com/384/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/learningsqlserver.wordpress.com/384/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/learningsqlserver.wordpress.com/384/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/learningsqlserver.wordpress.com/384/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/learningsqlserver.wordpress.com/384/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/learningsqlserver.wordpress.com/384/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/learningsqlserver.wordpress.com/384/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/learningsqlserver.wordpress.com/384/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/learningsqlserver.wordpress.com/384/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/learningsqlserver.wordpress.com/384/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/learningsqlserver.wordpress.com/384/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=learningsqlserver.wordpress.com&amp;blog=18456007&amp;post=384&amp;subd=learningsqlserver&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://learningsqlserver.wordpress.com/2011/02/07/so-youve-installed-sql-server-now-what/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/8a9fe2d08fee89240904f601e8120016?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">rothja</media:title>
		</media:content>

		<media:content url="http://learningsqlserver.files.wordpress.com/2011/02/filmstrip2.png" medium="image">
			<media:title type="html">Getting Started with SQL Server Video</media:title>
		</media:content>

		<media:content url="http://learningsqlserver.files.wordpress.com/2011/02/excelimporterror1.png" medium="image">
			<media:title type="html">Excel Import Error</media:title>
		</media:content>
	</item>
		<item>
		<title>SQL Server Management Studio (SSMS) Basics</title>
		<link>http://learningsqlserver.wordpress.com/2011/02/04/sql-server-management-studio-ssms-basics/</link>
		<comments>http://learningsqlserver.wordpress.com/2011/02/04/sql-server-management-studio-ssms-basics/#comments</comments>
		<pubDate>Fri, 04 Feb 2011 11:00:34 +0000</pubDate>
		<dc:creator>Jason Roth</dc:creator>
				<category><![CDATA[All]]></category>
		<category><![CDATA[Getting Started]]></category>
		<category><![CDATA[Management]]></category>
		<category><![CDATA[Database]]></category>
		<category><![CDATA[Databases]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SQL Server Management Studio]]></category>

		<guid isPermaLink="false">http://learningsqlserver.wordpress.com/?p=164</guid>
		<description><![CDATA[SQL Server Management Studio (SSMS) is one of the most important tools you&#8217;ll use with SQL Server. It provides a user-interface for common database tasks. Although not comprehensive, here are a few of the more common tasks: Create databases. Design tables and other database objects. Add, update, or delete data from databases. Backup and Restore [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=learningsqlserver.wordpress.com&amp;blog=18456007&amp;post=164&amp;subd=learningsqlserver&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>SQL Server Management Studio (<strong>SSMS</strong>) is one of the most important tools you&#8217;ll use with SQL Server. It provides a user-interface for common database tasks. Although not comprehensive, here are a few of the more common tasks:</p>
<ul>
<li>Create databases.</li>
<li>Design tables and other database objects.</li>
<li>Add, update, or delete data from databases.</li>
<li>Backup and Restore databases.</li>
<li>Run queries.</li>
</ul>
<p><span id="more-164"></span></p>
<h3><span style="text-decoration:underline;">Install SQL Server Management Studio</span></h3>
<p><img class="alignright size-full wp-image-166" style="margin-left:5px;margin-right:5px;" title="SQL Server 2008 R2 Menu Item" src="http://learningsqlserver.files.wordpress.com/2010/12/sqlserver2008r2menuitem.png?w=640" alt="SQL Server 2008 R2 Menu Item"   />If you have SQL Server installed, there is a good chance that you already have SSMS installed. The easiest way to tell is to look at the Start Menu. On the Start Menu, select All Programs, expand Microsoft SQL Server [YOURVERSION], and then look for SQL Server Management Studio. If you have it, skip down to the next section.</p>
<p>If you don&#8217;t have it, here are some quick points:</p>
<ol>
<li>First, make sure you&#8217;ve <a title="How to Install SQL Server 2008 R2 Express" href="http://learningsqlserver.wordpress.com/2011/01/24/how-to-install-sql-server-2008-r2-express/">installed SQL Server</a>. It helps if you understand <a title="Find your Installed SQL Server Versions and Instances" href="http://learningsqlserver.wordpress.com/2011/01/21/what-version-of-sql-server-do-i-have/">how to investigate what version(s) of SQL Server are installed on your machine</a>.</li>
<li>If you do have SQL Server installed, but you still don&#8217;t see the SQL Server Management Studio link, then it is possible that you installed the database engine without the tools. This is easily solved by running the SQL Server setup again (for the same version) and adding features to your existing database instance. The feature should be called &#8220;Management Tools&#8221;.</li>
<p><span style="text-decoration:underline;">﻿</span></ol>
<h3><span style="text-decoration:underline;">Connect to your SQL Server Instance</span></h3>
<p>Click &#8220;SQL Server Management Studio&#8221; on the start menu to launch it. This will bring up a connection dialog like this:</p>
<p><a href="http://learningsqlserver.files.wordpress.com/2011/01/sqlserverconnectiondialog1.png"><img class="alignnone size-medium wp-image-193" style="margin:5px;" title="SQL Server Management Studio Connection Dialog" src="http://learningsqlserver.files.wordpress.com/2011/01/sqlserverconnectiondialog1.png?w=300&#038;h=227" alt="SQL Server Management Studio Connection Dialog" width="300" height="227" /></a></p>
<p>The <strong>Server name </strong>field allows you to specify your SQL Server instance. This is the instance that contains and manages your databases. If you don&#8217;t know what instances are on your machine,<a title="Find your Installed SQL Server Versions and Instances" href="http://learningsqlserver.wordpress.com/2011/01/21/what-version-of-sql-server-do-i-have/"> it&#8217;s easy to find out</a>. For example, if you just installed the express edition, that instance is &#8220;.\SQLEXPRESS&#8221; by default. If it was another edition, you could have installed a different named instance in the form of &#8220;.\YOURNAMEDINSTANCE&#8221;. Or you could have installed the default instance, which is simply &#8220;.&#8221; or &#8220;YOURMACHINENAME&#8221; or &#8220;localhost&#8221;. Note that if your SQL Server is remote (and you have access), you just substitute the remote machine name. For example, if my machine name was MYREMOTEMACHINE, then the connection to SQLEXPRESS on that machine would be MYREMOTEMACHINE\SQLEXPRESS, and the connection to the default instance would just be MYREMOTEMACHINE.</p>
<p>Make sure the <strong>Server type </strong>is set to <strong>Database Engine</strong>. The <strong>Authentication </strong>setting controls the type of security you use to connect to SQL Server. By default SQL Server uses <strong>Windows Authentication </strong>and adds your user as a system administrator during installation. So that should work. But there will be other times where you may have to use <strong>SQL Server Authentication </strong>with a user name and password. Security will be discussed more in a future video.</p>
<h3><span style="text-decoration:underline;">Exploring the Object Explorer</span></h3>
<p><img class="alignleft size-medium wp-image-196" style="margin:0 5px;" title="SSMS Object Explorer" src="http://learningsqlserver.files.wordpress.com/2011/01/objectexplorer.png?w=213&#038;h=250" alt="SSMS Object Explorer" width="213" height="250" /></p>
<p>Once you connect, you&#8217;ll see the <strong>Object Explorer </strong>appear in the left-hand pane. When you&#8217;re first getting started with SSMS, my best tip is to learn by exploration. And the best way to explore is to right-click on the various nodes in the tree. For example, if you right-click on <strong>Databases</strong>, you&#8217;ll immediately see the <strong>&#8220;New Database&#8230;&#8221;</strong> option. Even if you don&#8217;t understand all of the options, you won&#8217;t ruin anything by clicking on the tasks and looking at the various dialogs. I find that this type of exploration can give you a sense of the capabilities of a tool before you ever start formally learning through other sources.</p>
<p>One quick warning. If you&#8217;ve used the steps above to connect to a SQL Server database that you don&#8217;t own, then you do want to be more careful with where you click. That&#8217;s why it&#8217;s good to learn on a local installation of SQL Server first.</p>
<p>Here is a very simplified list of tasks you can try from here:</p>
<ol>
<li>Create a database:
<ol>
<li>In the Object Explorer, right-click on &#8220;Databases&#8221;.</li>
<li>Select &#8220;New Database..&#8221;.</li>
<li>Give the Database a Name.</li>
<li>Press OK.</li>
</ol>
</li>
<li>Create a table:
<ol>
<li>Expand your new database in Object Explorer.</li>
<li>Right-click on &#8220;Tables&#8221;.</li>
<li>Select &#8220;New Table&#8230;&#8221;.</li>
<li>Specify the columns of the table.</li>
<li>Close the design window and save the changes.</li>
<li>Give the table a name in the &#8220;Choose Name&#8221; dialog, and press OK.</li>
</ol>
</li>
<li>Add data to a table:
<ol>
<li>Right-click on your new table.</li>
<li>Select &#8220;Edit Top 200 Rows&#8230;&#8221;.</li>
<li>Add rows of data to the table.</li>
<li>Close the editing window.</li>
</ol>
</li>
<li>Select data in a table:
<ol>
<li>Right-click on your new table.</li>
<li>Select &#8220;Select Top 1000 Rows&#8230;&#8221;.</li>
<li>View the results.</li>
</ol>
</li>
</ol>
<p>Again, the attempt here is not to be thorough or detailed but to show there are a lot of easy ways to quickly get started with SSMS just by exploring the UI.</p>
<h3><span style="text-decoration:underline;">Learning More</span></h3>
<p>Here are some other resources if you want to learn more about working with SQL Server Management Studio. If you come across a great resource for learning SSMS, please comment this post with it to help others.</p>
<ul>
<li><a title="SSMS documentation" href="http://msdn.microsoft.com/en-us/library/ms174173.aspx" target="_blank">SQL Server Management Studio</a> documentation on the MSDN Library.</li>
<li><a title="SSMS Tutorial" href="http://technet.microsoft.com/en-us/library/cc966390.aspx" target="_blank">Tutorial on managing SQL Server 2005 with SSMS</a> on Technet.</li>
</ul>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/learningsqlserver.wordpress.com/164/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/learningsqlserver.wordpress.com/164/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/learningsqlserver.wordpress.com/164/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/learningsqlserver.wordpress.com/164/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/learningsqlserver.wordpress.com/164/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/learningsqlserver.wordpress.com/164/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/learningsqlserver.wordpress.com/164/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/learningsqlserver.wordpress.com/164/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/learningsqlserver.wordpress.com/164/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/learningsqlserver.wordpress.com/164/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/learningsqlserver.wordpress.com/164/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/learningsqlserver.wordpress.com/164/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/learningsqlserver.wordpress.com/164/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/learningsqlserver.wordpress.com/164/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=learningsqlserver.wordpress.com&amp;blog=18456007&amp;post=164&amp;subd=learningsqlserver&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://learningsqlserver.wordpress.com/2011/02/04/sql-server-management-studio-ssms-basics/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/8a9fe2d08fee89240904f601e8120016?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">rothja</media:title>
		</media:content>

		<media:content url="http://learningsqlserver.files.wordpress.com/2010/12/sqlserver2008r2menuitem.png" medium="image">
			<media:title type="html">SQL Server 2008 R2 Menu Item</media:title>
		</media:content>

		<media:content url="http://learningsqlserver.files.wordpress.com/2011/01/sqlserverconnectiondialog1.png?w=300" medium="image">
			<media:title type="html">SQL Server Management Studio Connection Dialog</media:title>
		</media:content>

		<media:content url="http://learningsqlserver.files.wordpress.com/2011/01/objectexplorer.png?w=213" medium="image">
			<media:title type="html">SSMS Object Explorer</media:title>
		</media:content>
	</item>
		<item>
		<title>SQL Server Express for Beginners Video Series</title>
		<link>http://learningsqlserver.wordpress.com/2011/01/31/sql-server-2005-express-for-beginners-video-series/</link>
		<comments>http://learningsqlserver.wordpress.com/2011/01/31/sql-server-2005-express-for-beginners-video-series/#comments</comments>
		<pubDate>Mon, 31 Jan 2011 09:00:22 +0000</pubDate>
		<dc:creator>Jason Roth</dc:creator>
				<category><![CDATA[All]]></category>
		<category><![CDATA[Getting Started]]></category>
		<category><![CDATA[Database]]></category>
		<category><![CDATA[Databases]]></category>
		<category><![CDATA[Express]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SQL Server 2005]]></category>
		<category><![CDATA[Videos]]></category>

		<guid isPermaLink="false">http://learningsqlserver.wordpress.com/?p=107</guid>
		<description><![CDATA[I&#8217;d like to recommend an older, Microsoft-created video series called SQL Server 2005 Express for Beginners. Before you skip over this post, because you&#8217;re using SQL Server 2008, be aware that most of the material in these videos applies to SQL Server 2008 as well. Each video is 20 to 40 minutes long, so they [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=learningsqlserver.wordpress.com&amp;blog=18456007&amp;post=107&amp;subd=learningsqlserver&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.asp.net/sql-server/videos/sql-server-2005-express-for-beginners" target="_blank"><img class="alignleft size-thumbnail wp-image-318" title="SQL Server 2005 Express for Beginners Video Series" src="http://learningsqlserver.files.wordpress.com/2011/01/mc9004316211.png?w=104&#038;h=86" alt="SQL Server 2005 Express for Beginners Video Series" width="104" height="86" /></a>I&#8217;d like to recommend an older, Microsoft-created video series called<a title="SQL Server 2005 Express for Beginners" href="http://www.asp.net/sql-server/videos/sql-server-2005-express-for-beginners" target="_blank"> SQL Server 2005 Express for Beginners</a>. Before you skip over this post, because you&#8217;re using SQL Server 2008, be aware that most of the material in these videos applies to SQL Server 2008 as well. <span id="more-107"></span>Each video is 20 to 40 minutes long, so they go into quite a bit of detail. At the same time, they go slowly from describing databases to more advanced topics, such as stored procedures and reporting. Here is a list of direct links to the videos in the series:</p>
<table>
<tbody>
<tr>
<td><a href="http://www.asp.net/sql-server/videos/what-is-a-database" target="new">What Is a Database?</a> </td>
</tr>
<tr>
<td><a href="http://www.asp.net/sql-server/videos/understanding-database-tables-and-records" target="new">Understanding Database Tables and Records</a></td>
</tr>
<tr>
<td><a href="http://www.asp.net/sql-server/videos/more-about-column-data-types-and-other-properties" target="new">More about Column Data Types and Other Properties</a></td>
</tr>
<tr>
<td><a href="http://www.asp.net/sql-server/videos/designing-relational-database-tables" target="new">Designing Relational Database Tables</a></td>
</tr>
<tr>
<td><a href="http://www.asp.net/sql-server/videos/manipulating-database-data" target="new">Manipulating Database Data</a></td>
</tr>
<tr>
<td><a href="http://www.asp.net/sql-server/videos/more-structured-query-language" target="new">More Structured Query Language</a></td>
</tr>
<tr>
<td><a href="http://www.asp.net/sql-server/videos/understanding-security-and-network-connectivity" target="new">Understanding Security and Network Connnectivity</a></td>
</tr>
<tr>
<td><a href="http://www.asp.net/sql-server/videos/connecting-your-web-application-to-sql-server-2005-express-edition" target="new">Connecting your Web Application to SQL Server 2005 Express Edition</a></td>
</tr>
<tr>
<td><a href="http://www.asp.net/sql-server/videos/using-sql-server-management-studio" target="new">Using SQL Server Management Studio</a></td>
</tr>
<tr>
<td><a href="http://www.asp.net/sql-server/videos/getting-started-with-reporting-services" target="new">Getting Started with Reporting Services</a></td>
</tr>
<tr>
<td><a href="http://www.asp.net/sql-server/videos/building-and-customizing-reports-in-business-intelligence-development-studio" target="new">Building and Customizing Reports in Business Intelligence Development Studio</a></td>
</tr>
<tr>
<td><a href="http://www.asp.net/sql-server/videos/creating-and-using-stored-procedures" target="new">Creating and Using Stored Procedures</a></td>
</tr>
<tr>
<td><a href="http://www.asp.net/sql-server/videos/enabling-full-text-search-in-your-text-data" target="new">Enabling Full-Text Search in your Text Data</a></td>
</tr>
</tbody>
</table>
<p>If you&#8217;re following this blog, you&#8217;ll notice that we&#8217;re also creating videos to help you more easily learn SQL Server concepts. Why do this if there are other video series like this one? Here is our reasoning:</p>
<ul>
<li>First, when you&#8217;re learning it helps to<a href="http://www.asp.net/sql-server/videos/what-is-a-database" target="_blank"><img class="alignright size-medium wp-image-320" title="SQL Server 2005 Express for Beginners" src="http://learningsqlserver.files.wordpress.com/2011/01/express2005forbeginnersseries1.png?w=300&#038;h=280" alt="SQL Server 2005 Express for Beginners" width="300" height="280" /></a> hear the same material in different ways. So the more resources that are out there for the new user, the better.</li>
<li>The videos we&#8217;re creating are aiming for 5 to 10 minutes, which is a lot shorter than this 2005 series. Different people have different amounts of time and interest for watching videos.</li>
<li>Different videos, even ones on the same subject, can convey unique information, advice, or tricks to make them each useful.</li>
<li>Finally it can help to use the latest SQL Server product (2008 R2 at the time of this writing) for those times where there is a difference in UI or features. Also, people may never find the older video series like this that still apply if they are searching for videos on the latest release.</li>
</ul>
<p>As we find other resources, we&#8217;ll try to share them on this blog. If you have discovered other useful learning resources, please let us know.</p>
<div id="_mcePaste" class="mcePaste" style="position:absolute;width:1px;height:1px;overflow:hidden;top:0;left:-10000px;">﻿</div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/learningsqlserver.wordpress.com/107/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/learningsqlserver.wordpress.com/107/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/learningsqlserver.wordpress.com/107/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/learningsqlserver.wordpress.com/107/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/learningsqlserver.wordpress.com/107/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/learningsqlserver.wordpress.com/107/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/learningsqlserver.wordpress.com/107/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/learningsqlserver.wordpress.com/107/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/learningsqlserver.wordpress.com/107/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/learningsqlserver.wordpress.com/107/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/learningsqlserver.wordpress.com/107/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/learningsqlserver.wordpress.com/107/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/learningsqlserver.wordpress.com/107/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/learningsqlserver.wordpress.com/107/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=learningsqlserver.wordpress.com&amp;blog=18456007&amp;post=107&amp;subd=learningsqlserver&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://learningsqlserver.wordpress.com/2011/01/31/sql-server-2005-express-for-beginners-video-series/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/8a9fe2d08fee89240904f601e8120016?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">rothja</media:title>
		</media:content>

		<media:content url="http://learningsqlserver.files.wordpress.com/2011/01/mc9004316211.png?w=150" medium="image">
			<media:title type="html">SQL Server 2005 Express for Beginners Video Series</media:title>
		</media:content>

		<media:content url="http://learningsqlserver.files.wordpress.com/2011/01/express2005forbeginnersseries1.png?w=300" medium="image">
			<media:title type="html">SQL Server 2005 Express for Beginners</media:title>
		</media:content>
	</item>
		<item>
		<title>What is SQL Server Express?</title>
		<link>http://learningsqlserver.wordpress.com/2011/01/26/what-is-sql-server-express/</link>
		<comments>http://learningsqlserver.wordpress.com/2011/01/26/what-is-sql-server-express/#comments</comments>
		<pubDate>Wed, 26 Jan 2011 06:32:36 +0000</pubDate>
		<dc:creator>Jason Roth</dc:creator>
				<category><![CDATA[All]]></category>
		<category><![CDATA[Getting Started]]></category>
		<category><![CDATA[Express]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[Versions]]></category>

		<guid isPermaLink="false">http://learningsqlserver.wordpress.com/?p=266</guid>
		<description><![CDATA[Even if you&#8217;re completely new to SQL Server, you may have seen references to SQL Server Express. In fact, our last post was on installing SQL Server 2008 R2 Express. But  you might want to back up a bit. Exactly what is Express and what can it do? Starting with SQL Server 2005, SQL Server Express [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=learningsqlserver.wordpress.com&amp;blog=18456007&amp;post=266&amp;subd=learningsqlserver&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Even if you&#8217;re completely new to SQL Server, you may have seen references to SQL Server Express. In fact, our last post was on <a title="How to Install SQL Server 2008 R2 Express" href="http://learningsqlserver.wordpress.com/2011/01/24/how-to-install-sql-server-2008-r2-express/">installing SQL Server 2008 R2 Express</a>. But  you might want to back up a bit. Exactly what is Express and what can it do?</p>
<p><span id="more-266"></span></p>
<p>Starting with SQL Server 2005, <a href="http://www.microsoft.com/express/Database/" target="_blank">SQL Server Express</a> has been a free edition of the Microsoft SQL Server database engine (if you&#8217;re not familiar with databases, <a title="Before We Begin: What is a Relational Database?" href="http://learningsqlserver.wordpress.com/2011/01/18/before-we-begin-what-is-a-relational-database/">go here</a>). The great thing about SQL Server Express is that it is the exact same database engine that ships with all of the other paid editions, like Enterprise or Data Center. And you can redistribute it and use it in real-world applications. The only difference is that it lacks some advanced features and has specific limitations, such as 1 CPU and 10GB database size. But these limitations leave you with a lot of room to learn and use SQL Server until you require additional space, processing power, or features.</p>
<div id="attachment_304" class="wp-caption alignright" style="width: 160px"><a href="http://channel9.msdn.com/blogs/zachskylesowens/sql-server-express-overview" target="_blank"><img class="size-thumbnail wp-image-304" title="Channel 9" src="http://learningsqlserver.files.wordpress.com/2011/01/channel9.png?w=150&#038;h=78" alt="Channel 9" width="150" height="78" /></a><p class="wp-caption-text">See the Video!</p></div>
<p>If you want to get a great overview of SQL Server 2008 Express, view this channel 9 video: <a href="http://channel9.msdn.com/blogs/zachskylesowens/sql-server-express-overview" target="_blank">SQL Server Express: Overview</a>. Just note that this was created for 2008 rather than 2008 R2. So the database limitation of 4GB that they mention has been increased to 10GB in R2. To see exact details on the differences between editions, try out this great comparison tool: <a href="http://www.microsoft.com/sqlserver/en/us/product-info/compare.aspx" target="_blank">Compare SQL Server 2008 R2 Editions</a>.</p>
<p>And if you want to understand the differences between all SQL editions, a page like this is invaluable: <a href="http://www.microsoft.com/sqlserver/en/us/editions.aspx" target="_blank">Microsoft SQL Server 2008 R2 Editions</a>.</p>
<p>Finally, there is often confusion between SQL Server Express and <a href="http://www.microsoft.com/sqlserver/en/us/editions/compact.aspx" target="_blank">SQL Server Compact Edition</a>. The compact edition has even less features than Express, but this is by design. It is meant to be extremely small and light, so that you can embed it in an application. A typical use might be a phone application that then synchronizes with an online data source. Both Compact and Express are freely distributable. But the Compact edition has more specific use cases. If you&#8217;re trying to learn SQL Server with the intention of being able to work in multiple editions, then use SQL Server Express. If you want to understand the differences better, download <a href="http://download.microsoft.com/download/A/4/7/A47B7B0E-976D-4F49-B15D-F02ADE638EBE/Compact_Express_Comparison.doc" target="_blank">a white paper that discuss the differences between the Compact edition and the Express edition</a>. It talks about 2005 rather than 2008, so some of the information is out-of-date. But the concepts are the same. On a side-note, I really believe in not discounting older material like this, because it is often when a feature is first released that the most introductory content is created. Since many of the featues in SQL Server 2005 have moved into SQL Server 2008, you may find excellent SQL Server 2005 resources that still help you in the latest release.</p>
<p>Other resources:</p>
<ul>
<li><a href="http://www.microsoft.com/express/Database/" target="_blank">SQL Server 2008 R2 Express Overview and Installation page</a> (Microsoft.com)</li>
<li><a href="http://blog.sqlauthority.com/2009/04/22/sql-server-difference-between-sql-server-compact-edition-ce-and-sql-server-express-edition/" target="_blank">Difference Between SQL Server Compact Edition (CE) and SQL Server Express Edition </a>(SQLAuthority.com)</li>
<li><a href="http://msdn.microsoft.com/en-us/library/ms144275.aspx" target="_blank">Editions and Components of SQL Server 2008 R2</a> (MSDN)</li>
<li><a href="http://sqlserverpedia.com/wiki/SQL_Server_Express_Edition" target="_blank">SQL Server Express Edition </a>(SQLServerPedia.com)</li>
</ul>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/learningsqlserver.wordpress.com/266/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/learningsqlserver.wordpress.com/266/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/learningsqlserver.wordpress.com/266/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/learningsqlserver.wordpress.com/266/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/learningsqlserver.wordpress.com/266/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/learningsqlserver.wordpress.com/266/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/learningsqlserver.wordpress.com/266/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/learningsqlserver.wordpress.com/266/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/learningsqlserver.wordpress.com/266/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/learningsqlserver.wordpress.com/266/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/learningsqlserver.wordpress.com/266/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/learningsqlserver.wordpress.com/266/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/learningsqlserver.wordpress.com/266/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/learningsqlserver.wordpress.com/266/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=learningsqlserver.wordpress.com&amp;blog=18456007&amp;post=266&amp;subd=learningsqlserver&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://learningsqlserver.wordpress.com/2011/01/26/what-is-sql-server-express/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/8a9fe2d08fee89240904f601e8120016?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">rothja</media:title>
		</media:content>

		<media:content url="http://learningsqlserver.files.wordpress.com/2011/01/channel9.png?w=150" medium="image">
			<media:title type="html">Channel 9</media:title>
		</media:content>
	</item>
	</channel>
</rss>
