<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>devtrends.com &#187; SQL Express</title>
	<atom:link href="http://www.devtrends.com/index.php/tag/sql-express/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.devtrends.com</link>
	<description>developing trends in information technology</description>
	<lastBuildDate>Tue, 06 Sep 2011 19:27:42 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Scheduling Database Backups with SQL Server Express</title>
		<link>http://www.devtrends.com/index.php/scheduling-database-backups-with-sql-server-express/</link>
		<comments>http://www.devtrends.com/index.php/scheduling-database-backups-with-sql-server-express/#comments</comments>
		<pubDate>Tue, 17 Nov 2009 15:02:13 +0000</pubDate>
		<dc:creator>aaron</dc:creator>
				<category><![CDATA[SQL Express]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[SQL Scripts]]></category>
		<category><![CDATA[SQL Server]]></category>

		<guid isPermaLink="false">http://www.devtrends.com/?p=458</guid>
		<description><![CDATA[In this article I will present a simple way to backup active databases from SQL Express without the need for the SQL Agent or shutting down the SQL Server database...]]></description>
			<content:encoded><![CDATA[<p>In this article I will present a simple way to backup active databases from SQL Express without the need for the SQL Agent or shutting down the SQL Server database engine. For those that are not aware, the SQL Agent is not available with the Express editions of SQL Server. Never-the-less, SQL Express is quite powerful and is more frequently deployed in the enterprise than not, hence the need for third party software backup software/agents or free methods&#8230;such as this one.</p>
<p>This method uses OSQL and an input .sql file containing the SQL commands needed to backup the database(s). If you are unfamilar with the necessary SQL commands to back up a database, we can generate the script from the <a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=C243A5AE-4BD1-4E3D-94B8-5A0F62BF7796&amp;displaylang=en" target="_blank">SQL Server Management Studio Express </a>application.</p>
<p>1. Use SQL Management Server to script a Backup Job similar to the one below. The method for creating a script instead of performing the actual action is to begin the Backup task and use the &#8220;Script&#8221; button, choose Script Action to File:</p>
<p><a href="http://www.developingtrends.net/wp-content/uploads/2009/11/sql1.jpg"><img class="alignnone size-medium wp-image-461" title="sql1" src="http://www.devtrends.com/wp-content/uploads/2009/11/sql1-300x232.jpg" alt="sql1" width="300" height="232" /></a></p>
<p><a href="http://www.developingtrends.net/wp-content/uploads/2009/11/sql2.jpg"><img class="alignnone size-medium wp-image-462" title="sql2" src="http://www.devtrends.com/wp-content/uploads/2009/11/sql2-300x269.jpg" alt="sql2" width="300" height="269" /></a></p>
<pre style="padding-left: 30px; white-space: pre-wrap; word-wrap: break-word;">BACKUP DATABASE [(database name)] TO  DISK = N'C:\SQL Backups\(file name).bak' WITH NOFORMAT, NOINIT,  NAME = N'(backup name)-Full Database Backup', SKIP, NOREWIND, NOUNLOAD,  STATS = 10
GO</pre>
<p>Save the file to the location where you can find and use the file in the future. In my example, I saved all scripts to the C:\SQL Backups\ folder. If you use my example, make sure you replace the fields marked with () and omit the parentheses.</p>
<p>2. Verify that the SQL Server allows Windows and SQL Authentication. In the <a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=C243A5AE-4BD1-4E3D-94B8-5A0F62BF7796&amp;displaylang=en" target="_blank">SQL Server Management Studio Express </a>application, right click on the server, choose properties, and then click on the security tab. This change will require a restart of the SQL Server engine.</p>
<p>3. Create a local SQL user with the necessary access to the databases that you will be backing up. In my example I assigned sysadmin to the backup user, which I named SQLBackups.</p>
<p>4. Now we need to create a scheduled job in Windows &#8220;Scheduled Tasks&#8221; to run at the specified time of our choosing. Although you may place the full command in the scheduled task program text box, I would recommend placing the following in a batch file (stored with the .sql file):</p>
<pre style="padding-left: 30px; white-space: pre-wrap; word-wrap: break-word;">@ECHO OFF
del "[FULL PATH TO SQL BACKUP FILE]"
osql -S [SERVER]\[INSTANCE] -U [USERNAME] -P [PASSWORD] -i "[FULL PATH TO SQL FILE]"</pre>
<p>When replacing the values to match your configuration, omit the brackets []. In addition, ensure your have the SERVER\INSTANCE correct.</p>
<p>5. Thats it!</p>
<p>Common Error:</p>
<pre style="padding-left: 30px; white-space: pre-wrap; word-wrap: break-word;">Login failed for user 'SQLBackups'. The user is not associated with a trusted
SQL Server connection.</pre>
<p>You must enable Windows Auth and SQL Auth in server properties and then restart the SQL server service.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.devtrends.com/index.php/scheduling-database-backups-with-sql-server-express/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Changing the SA password in SQL Express 2005</title>
		<link>http://www.devtrends.com/index.php/changing-the-sa-password-in-sql-express-2005/</link>
		<comments>http://www.devtrends.com/index.php/changing-the-sa-password-in-sql-express-2005/#comments</comments>
		<pubDate>Mon, 25 Aug 2008 02:48:07 +0000</pubDate>
		<dc:creator>aaron</dc:creator>
				<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[SQL Express]]></category>

		<guid isPermaLink="false">http://www.devtrends.com/?p=18</guid>
		<description><![CDATA[Sometimes when you install SQL Express 2005 as a component of another product, that application installation will configure the environment, effectively restricting your access to the SQL database. This is...]]></description>
			<content:encoded><![CDATA[<p>Sometimes when you install SQL Express 2005 as a component of another product, that application installation will configure the environment, effectively restricting your access to the SQL database. This is primarily due to the application setting the SA password and not telling you what it is.</p>
<p>With SQL Express 2005, the new command line is sqlcmd, which supposedly replaces osql.</p>
<p><strong><span style="font-size: medium;">Resetting the SA password</span></strong></p>
<p>If you need access to the database, you can reset the SA password using the following commands from a command prompt (cmd):</p>
<p>sqlcmd –S SQLSERVER\INSTANCE</p>
<p>Once in the interface for sqlcmd, which is represented by a 1&gt;, type the following on separate lines:</p>
<ul>
<li>sp_password @new = ’newpassword’, @loginame = ‘sa’</li>
<li>go</li>
<li>exit</li>
</ul>
<p>Just so you know, the @loginame procedure does have only one “n”.</p>
<h2>Unlocking the SA user</h2>
<p>If you have tried to access the database too many times with the wrong password, the SA account may be locked out. Do the following to unlock the account from a command prompt (cmd):</p>
<p>sqlcmd –S SQLSERVER\INSTANCE</p>
<p>Once in the interface for sqlcmd, which is represented by a 1&gt;, type the following on separate lines:</p>
<ul>
<li>ALTER LOGIN sa WITH PASSWORD = ‘newpassword’ UNLOCK</li>
<li>go</li>
<li>exit</li>
</ul>
<h2>Test It</h2>
<p>You can test the user account, SA, by trying to connect with the SA account from whatever program you are using, installing, et cetera, or you can use OSQL to attempt a connection. From a command prompt (cmd), type the following:</p>
<p>osql –U sa –S SQLSERVER\INSTANCE<br />
Enter your password<br />
At the 1&gt; prompt, type exit</p>
<h2>Links</h2>
<p>Microsoft has more information about the topic covered in this article at: <a href="http://support.microsoft.com/kb/322336">http://support.microsoft.com/kb/322336</a></p>
<p><a href="http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=306429&amp;SiteID=1">http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=306429&amp;SiteID=1</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.devtrends.com/index.php/changing-the-sa-password-in-sql-express-2005/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

