<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://sqlblog.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Search results matching tag 'Azure VM'</title><link>http://sqlblog.com/search/SearchResults.aspx?o=DateDescending&amp;tag=Azure+VM&amp;orTags=0</link><description>Search results matching tag 'Azure VM'</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP2 (Build: 61129.1)</generator><item><title>SQL Server Backup to Cloud – Managing Interrupted backups  </title><link>http://sqlblog.com/blogs/sqlos_team/archive/2013/03/12/sql-server-backup-to-cloud-managing-interrupted-backups.aspx</link><pubDate>Tue, 12 Mar 2013 21:48:00 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:48228</guid><dc:creator>SQLOS Team</dc:creator><description>&lt;div&gt;
&lt;p&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;Writer: Karthika Raman&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;Technical Reviewers: Guy Bowerman, Pat Schaefer, Andrew Cherry&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;span style="font-family:Calibri;font-size:small;"&gt;&lt;/span&gt;&amp;nbsp;&lt;/p&gt;

&lt;p&gt;&lt;span style="font-family:Calibri;font-size:small;"&gt;On January 24, 2013, the SQL Server engineering team released new functionality in SQL Server 2012 SP1 CU2, enabling &lt;/span&gt;&lt;a href="http://sqlblog.com/b/windowsazure/archive/2013/01/24/sql-server-backup-and-restore-to-cloud-simplified.aspx"&gt;&lt;span style="font-family:Calibri;font-size:small;"&gt;SQL Server native backup to cloud&lt;/span&gt;&lt;/a&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;. The steps to creating a SQL Server backup to Windows Azure Blob storage are simple, but if a backup is interrupted it can leave behind blob files that require additional steps to delete.&amp;nbsp; Some of this information along with other best practices and troubleshooting tips is addressed in the &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/jj919149.aspx"&gt;&lt;span style="font-family:Calibri;font-size:small;"&gt;Best Practices topic&lt;/span&gt;&lt;/a&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt; in SQL Server Books online.&amp;nbsp; In this blog post, we focus on the interrupted backup scenario, identifying locked blobs that might be partial or corrupt as a result of interrupted backups, and deleting them. &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;span style="font-family:Calibri;font-size:small;"&gt;The&amp;nbsp;&lt;span&gt;&lt;u&gt;Blob, Blob Leases, and SQL Server&lt;/u&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Calibri;font-size:small;"&gt;&amp;nbsp;section provides background information about blobs and leases in relation to SQL Server Backup to cloud. The&amp;nbsp;&lt;span&gt;&lt;u&gt;Managing Interrupted Backup&lt;/u&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;&amp;nbsp;section discusses managing interrupted backups and a sample PowerShell code you can use to get started.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;h2&gt;&lt;span style="font-size:medium;"&gt;&lt;span&gt;&lt;span style="font-family:Cambria;"&gt;Blobs, Blob Leases, and SQL Server&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;p&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;In order to get exclusive write access to a blob, a lease is acquired. Acquiring a lease helps avoid accidental overwrites or deletes when there is already another process accessing a blob. Blob leases are two types:&amp;nbsp; One type of lease has a set duration.&amp;nbsp; This duration can be anywhere from 15 to 60 seconds. The lease is active for the time of duration, but can be reacquired before it expires, to complete the backup or restore process, by specifying the existing lease Id.&amp;nbsp;&amp;nbsp; The other type where there is no set duration is an infinite lease.&amp;nbsp; Infinite leases are active unless explicitly released or broken.&amp;nbsp; In effect, the infinite lease on a blob acts like a lock.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;SQL Server acquires an infinite lease for backup and restore processes.&amp;nbsp; In the case of backup, a unique lease Id is used, and in the case of restore, a known lease id ‘BAC2BAC2BAC2BAC2BAC2BAC2BAC2BAC2’ is used.&amp;nbsp; Once the backup or restore process is successfully completed, the lease is released.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;What happens when a backup or restore is interrupted?&lt;/span&gt; &lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;During restores, the restore process always attempts to release the lease unless the network is interrupted.&amp;nbsp; If the lease remains active, overwrites or deletes cannot be performed until the lease is broken or released through a subsequent restore.&amp;nbsp; So an interrupted restore may not often be something that requires close monitoring.&amp;nbsp; However, interrupted backups present a different scenario.&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;If the backup process is interrupted, it can result in a partial or corrupt blob with an active lease which remains, blocking any overwrites, or deletes.&amp;nbsp; It also prevents any restores using this file, since the restore process needs to acquire a lease with the well-known lease Id, but the existing active backup lease prevents this – which is probably a desirable result as the file could be partial or corrupt.&amp;nbsp; So with an active lease on the blob, the blob remains locked until the lease is explicitly broken.&lt;/span&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/p&gt;
&lt;h2&gt;&lt;span style="font-size:medium;"&gt;&lt;span&gt;&lt;span style="font-family:Cambria;"&gt;Managing Interrupted Backups&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;p&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;As stated in the section above, interrupted backups need to be monitored and managed.&amp;nbsp; This section walks through the process of monitoring interrupted backups, identifying locked blobs, and breaking the lease using PowerShell scripts. &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;Backups can be interrupted due to several reasons such as network failures, process canceled by the user, power outage etc.&amp;nbsp; As interrupted backups can result in a partial blob with an active lease, in order to overwrite this file or delete it, you must first identify such blobs and break the lease.&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;One way to identify such blobs is to actively monitor backup return codes/errors and interrupted backups.&amp;nbsp; Below is a list of error/return codes that are returned from SQL Server Backup and restore process, which you can use to monitor for blob files with active leases.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p style="padding-left:30px;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;Msg 3202, Level 16, State 1, Line 1&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p style="padding-left:30px;"&gt;&lt;span style="font-family:Calibri;font-size:small;"&gt;Write on "&lt;/span&gt;&lt;a href="https://mystorage.blob.core.windows.net/mycontainer/test.bak"&gt;&lt;span style="font-family:Calibri;font-size:small;"&gt;https&lt;/span&gt;&lt;/a&gt;&lt;a href="https://mystorage.blob.core.windows.net/mycontainer/test.bak"&gt;&lt;span style="font-family:Calibri;font-size:small;"&gt;://mystorage.blob.core.windows.net/mycontainer/test.bak&lt;/span&gt;&lt;/a&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;" failed: Backup to URL received an exception from the remote endpoint. Exception Message: The remote server returned an error: &lt;span&gt;(412)&lt;/span&gt; There is currently a lease on the blob and no lease ID was specified in the request.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p style="padding-left:30px;"&gt;&lt;span style="font-family:Calibri;font-size:small;"&gt;BackupIoRequest::ReportIoError: read failure on backup device &lt;/span&gt;&lt;a href="https://mystorage.blob.core.windows.net/mycontainer/test.bak"&gt;&lt;span style="font-family:Calibri;font-size:small;"&gt;https://mystorage.blob.core.windows.net/mycontainer/test.bak &lt;/span&gt;&lt;/a&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;'. Operating system error Backup to URL received an exception from the remote endpoint. Exception Message: The remote server returned an error: &lt;span&gt;(409)&lt;/span&gt; Conflict..&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;This method won’t catch cases where the backup process is aborted or the machine goes down.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;Another way is to run a script periodically to look for blobs with active leases in the storage account.&amp;nbsp; The PowerShell script example included here is a good starting point.&amp;nbsp; The PowerShell script establishes an authenticated connection to the storage account, looks for all files in a specified container that are in a ‘locked’ state and filters out restore leases using the well-known lease Id.&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;Below is the PowerShell example to identify locked blobs and breaking the lease. &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Calibri;font-size:small;"&gt;A downloadable version of the code is available on the &lt;/span&gt;&lt;a href="http://gallery.technet.microsoft.com/Breaking-leases-on-locked-28f896dc"&gt;&lt;span style="font-family:Calibri;font-size:small;"&gt;TechNet code gallery&lt;/span&gt;&lt;/a&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;span style="font-size:small;"&gt;Important Note:&amp;nbsp; &lt;/span&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;span style="font-size:small;"&gt;This example is intended to show how to break a lease, but running this while a backup is running will cause the backup to fail as it will break the lease that SQL Server acquired to do the backup.&amp;nbsp; Before running this script or scheduling it, ensure that no backup is running at the same time.&lt;/span&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;span&gt;param&lt;/span&gt;(&lt;/p&gt;

&lt;p style="padding-left:60px;"&gt;[&lt;span&gt;Parameter&lt;/span&gt;(Mandatory&lt;span&gt;=&lt;/span&gt;&lt;span&gt;$true&lt;/span&gt;)]&lt;/p&gt;

&lt;p style="padding-left:60px;"&gt;[string]&lt;span&gt;$storageAccount&lt;/span&gt;,&lt;/p&gt;

&lt;p style="padding-left:60px;"&gt;[&lt;span&gt;Parameter&lt;/span&gt;(Mandatory&lt;span&gt;=&lt;/span&gt;&lt;span&gt;$true&lt;/span&gt;)]&lt;/p&gt;

&lt;p style="padding-left:60px;"&gt;[string]&lt;span&gt;$storageKey&lt;/span&gt;,&lt;/p&gt;

&lt;p style="padding-left:60px;"&gt;[&lt;span&gt;Parameter&lt;/span&gt;(Mandatory&lt;span&gt;=&lt;/span&gt;&lt;span&gt;$true&lt;/span&gt;)]&lt;/p&gt;

&lt;p style="padding-left:60px;"&gt;[string]&lt;span&gt;$blobContainer&lt;/span&gt;,&lt;/p&gt;

&lt;p style="padding-left:60px;"&gt;[&lt;span&gt;Parameter&lt;/span&gt;(Mandatory&lt;span&gt;=&lt;/span&gt;&lt;span&gt;$true&lt;/span&gt;)]&lt;/p&gt;

&lt;p style="padding-left:60px;"&gt;[string]&lt;span&gt;$storageAssemblyPath&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;)&lt;/p&gt;

&lt;p&gt;&lt;span&gt;# Well known Restore Lease ID&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;span&gt;$restoreLeaseId&lt;/span&gt; &lt;span&gt;=&lt;/span&gt; &lt;span&gt;"BAC2BAC2BAC2BAC2BAC2BAC2BAC2BAC2"&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;span&gt;# Load the storage assembly without locking the file for the duration of the PowerShell session&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;span&gt;$bytes&lt;/span&gt; = &lt;span&gt;[System.IO.File]&lt;/span&gt;&lt;span&gt;::&lt;/span&gt;ReadAllBytes(&lt;span&gt;$storageAssemblyPath&lt;/span&gt;)&lt;/p&gt;

&lt;p&gt;&lt;span&gt;[System.Reflection.Assembly]&lt;/span&gt;&lt;span&gt;::&lt;/span&gt;Load(&lt;span&gt;$bytes&lt;/span&gt;)&lt;/p&gt;

&lt;p&gt;&lt;span&gt;$cred&lt;/span&gt; &lt;span&gt;=&lt;/span&gt; &lt;span&gt;New-Object &lt;/span&gt;&lt;span&gt;'Microsoft.WindowsAzure.Storage.Auth.StorageCredentials' &lt;/span&gt;&lt;span&gt;$storageAccount&lt;/span&gt;, &lt;span&gt;$storageKey&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;span&gt;$client&lt;/span&gt; &lt;span&gt;=&lt;/span&gt; &lt;span&gt;New-Object&lt;/span&gt; &lt;span&gt;'Microsoft.WindowsAzure.Storage.Blob.CloudBlobClient' "https://&lt;/span&gt;&lt;span&gt;$storageAccount&lt;/span&gt;.blob.core.windows.net", &lt;span&gt;$cred&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;span&gt;$container&lt;/span&gt;&lt;span&gt; =&lt;/span&gt; &lt;span&gt;$client&lt;/span&gt;.GetContainerReference(&lt;span&gt;$blobContainer&lt;/span&gt;)&lt;/p&gt;

&lt;p&gt;&lt;span&gt;#list all the blobs&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;span&gt;$allBlobs&lt;/span&gt; &lt;span&gt;=&lt;/span&gt; &lt;span&gt;$container&lt;/span&gt;.ListBlobs()&lt;/p&gt;

&lt;p&gt;&lt;span&gt;$lockedBlobs&lt;/span&gt; &lt;span&gt;=&lt;/span&gt; @()&lt;/p&gt;

&lt;p&gt;&lt;span&gt;# filter blobs that are have Lease Status as "locked"&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;span&gt;foreach&lt;/span&gt;(&lt;span&gt;$blob&lt;/span&gt;&lt;span&gt; in &lt;/span&gt;&lt;span&gt;$allBlobs&lt;/span&gt;)&lt;/p&gt;

&lt;p&gt;{&lt;/p&gt;

&lt;p&gt;&lt;span&gt;$blobProperties&lt;/span&gt; &lt;span&gt;=&lt;/span&gt; &lt;span&gt;$blob&lt;/span&gt;.Properties&lt;/p&gt;

&lt;p&gt;if(&lt;span&gt;$blobProperties&lt;/span&gt;.LeaseStatus &lt;span&gt;-eq&lt;/span&gt; &lt;span&gt;"Locked"&lt;/span&gt;)&lt;/p&gt;

&lt;p style="padding-left:30px;"&gt;{&lt;/p&gt;

&lt;p style="padding-left:60px;"&gt;&lt;span&gt;$lockedBlobs&lt;/span&gt; &lt;span&gt;+=&lt;/span&gt; $blob&lt;/p&gt;

&lt;p style="padding-left:30px;"&gt;}&lt;/p&gt;

&lt;p&gt;}&lt;/p&gt;

&lt;p&gt;if (&lt;span&gt;$lockedBlobs&lt;/span&gt;.Count &lt;span&gt;-eq &lt;/span&gt;&lt;span&gt;0&lt;/span&gt;)&lt;/p&gt;

&lt;p style="padding-left:30px;"&gt;{&lt;/p&gt;

&lt;p style="padding-left:60px;"&gt;&lt;span&gt;Write-Host&lt;/span&gt; &lt;span&gt;" There are no blobs with locked lease status"&lt;/span&gt;&lt;/p&gt;

&lt;p style="padding-left:30px;"&gt;}&lt;/p&gt;

&lt;p&gt;if(&lt;span&gt;$lockedBlobs&lt;/span&gt;.Count -gt 0)&lt;/p&gt;

&lt;p style="padding-left:30px;"&gt;{&lt;/p&gt;

&lt;p style="padding-left:60px;"&gt;&lt;span&gt;write-host&lt;/span&gt; &lt;span&gt;"Breaking leases"&lt;/span&gt;&lt;/p&gt;

&lt;p style="padding-left:60px;"&gt;&lt;span&gt;foreach&lt;/span&gt;(&lt;span&gt;$blob&lt;/span&gt; &lt;span&gt;in&lt;/span&gt; &lt;span&gt;$lockedBlobs&lt;/span&gt; )&lt;/p&gt;

&lt;p style="padding-left:60px;"&gt;{&lt;/p&gt;

&lt;p style="padding-left:90px;"&gt;try&lt;/p&gt;

&lt;p style="padding-left:90px;"&gt;{&lt;/p&gt;

&lt;p style="padding-left:120px;"&gt;&lt;span&gt;$blob&lt;/span&gt;.AcquireLease(&lt;span&gt;$null&lt;/span&gt;, &lt;span&gt;$restoreLeaseId&lt;/span&gt;,&lt;span&gt; $null&lt;/span&gt;, &lt;span&gt;$null&lt;/span&gt;, &lt;span&gt;$null&lt;/span&gt;)&lt;/p&gt;

&lt;p style="padding-left:120px;"&gt;&lt;span&gt;Write-Host&lt;/span&gt; &lt;span&gt;"The lease on&lt;/span&gt; $(&lt;span&gt;$blob&lt;/span&gt;.Uri) &lt;span&gt;is a restore lease"&lt;/span&gt;&lt;/p&gt;

&lt;p style="padding-left:90px;"&gt;}&lt;/p&gt;

&lt;p style="padding-left:90px;"&gt;catch &lt;span&gt;[Microsoft.WindowsAzure.Storage.StorageException]&lt;/span&gt;&lt;/p&gt;

&lt;p style="padding-left:90px;"&gt;{&lt;/p&gt;

&lt;p style="padding-left:120px;"&gt;if(&lt;span&gt;$&lt;/span&gt;_.Exception.RequestInformation.HttpStatusCode &lt;span&gt;-eq &lt;/span&gt;&lt;span&gt;409&lt;/span&gt;)&lt;/p&gt;

&lt;p style="padding-left:120px;"&gt;{&lt;/p&gt;

&lt;p style="padding-left:150px;"&gt;&lt;span&gt;Write-Host&lt;/span&gt; &lt;span&gt;"The lease on&lt;/span&gt; $(&lt;span&gt;$blob&lt;/span&gt;.Uri) &lt;span&gt;is not a restore lease"&lt;/span&gt;&lt;/p&gt;

&lt;p style="padding-left:120px;"&gt;}&lt;/p&gt;

&lt;p style="padding-left:90px;"&gt;}&lt;/p&gt;

&lt;p style="padding-left:90px;"&gt;&lt;span&gt;Write-Host&lt;/span&gt; &lt;span&gt;"Breaking lease on&lt;/span&gt; $(&lt;span&gt;$blob&lt;/span&gt;.Uri)&lt;span&gt;"&lt;/span&gt;&lt;/p&gt;

&lt;p style="padding-left:90px;"&gt;&lt;span&gt;$blob&lt;/span&gt;.BreakLease($(&lt;span&gt;New-TimeSpan&lt;/span&gt;), &lt;span&gt;$null&lt;/span&gt;, &lt;span&gt;$null&lt;/span&gt;, &lt;span&gt;$null&lt;/span&gt;) &lt;span&gt;|&lt;/span&gt; &lt;span&gt;Out-Null&lt;/span&gt;&lt;/p&gt;

&lt;p style="padding-left:60px;"&gt;}&lt;/p&gt;

&lt;p style="padding-left:30px;"&gt;}&lt;/p&gt;

&lt;h4&gt;&lt;em&gt;&lt;span&gt;&lt;span style="font-family:Cambria;"&gt;&lt;span style="font-size:small;"&gt;How to test the interrupted backup scenario using the script.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/em&gt;&lt;/h4&gt;
&lt;p&gt;&lt;span style="font-family:Calibri;"&gt;&lt;span style="font-size:small;"&gt;The following is a self-guided walkthrough of creating a locked blob by interrupting a backup process, and using the script to release the lease to successfully delete the blob file that resulted from the interrupted backup.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;The script prompts for storage account name, storage access key, container name, and the path and file name of the Windows Azure Storage Assembly.&amp;nbsp; You can either choose to provide these interactively or you can replace the params () section like this:&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p style="padding-left:60px;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;#provide values for parameters&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p style="padding-left:60px;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;&lt;span&gt;$storageAccount&lt;/span&gt; &lt;span&gt;=&lt;/span&gt; &lt;span&gt;"mycloudstorage"&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p style="padding-left:60px;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;&lt;span&gt;$storageKey&lt;/span&gt; &lt;span&gt;=&lt;/span&gt; &lt;span&gt;"&amp;lt;primary/secondary access key value of the storage account&amp;gt;”&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p style="padding-left:60px;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;&lt;span&gt;$blobContainer&lt;/span&gt; &lt;span&gt;=&lt;/span&gt; &lt;span&gt;"sqlbackup"&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p style="padding-left:60px;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;&lt;span&gt;$storageAssemblyPath&lt;/span&gt;&lt;span&gt; =&lt;/span&gt; &lt;span&gt;"C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\Binn\Microsoft.WindowsAzure.Storage.dll"&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p style="padding-left:60px;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;Note:&amp;nbsp; The storage assembly is stored in the Binn folder of the SQL Server 2012 SP1 CU2 instance. In the above example, it is the default SQL Server instance.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;Create a SQL Server Backup to Windows Azure blob storage which completes successfully.&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p style="padding-left:60px;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;&lt;a href="http://blogs.msdn.com/cfs-filesystemfile.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-83-23/1817.InterruptedBackup_5F00_Step2.jpg"&gt;&lt;img alt="" src="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-83-23/1817.InterruptedBackup_5F00_Step2.jpg" border="0"&gt;&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;span style="font-family:Calibri;font-size:small;"&gt;Run the PowerShell script.&amp;nbsp; It returns a message that says that there are no locked blobs.&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p style="padding-left:60px;"&gt;&lt;span style="font-family:Calibri;font-size:small;"&gt;&lt;a href="http://blogs.msdn.com/cfs-filesystemfile.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-83-23/0871.InterruptedBackup_5F00_Step3.jpg"&gt;&lt;img alt="" src="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-83-23/0871.InterruptedBackup_5F00_Step3.jpg" border="0"&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;span style="font-family:Calibri;font-size:small;"&gt;Now run another SQL Server backup but stop it before it can complete to simulate interrupted backup scenario.&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p style="padding-left:60px;"&gt;&lt;span style="font-family:Calibri;font-size:small;"&gt;&lt;a href="http://blogs.msdn.com/cfs-filesystemfile.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-83-23/3678.InterruptedBackup_5F00_Step4.jpg"&gt;&lt;img alt="" src="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-83-23/3678.InterruptedBackup_5F00_Step4.jpg" border="0"&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;Check to see if the file was created on the storage account.&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p style="padding-left:60px;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;&lt;a href="http://blogs.msdn.com/cfs-filesystemfile.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-83-23/0083.InterruptedBackup_5F00_Step5.jpg"&gt;&lt;img alt="" src="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-83-23/0083.InterruptedBackup_5F00_Step5.jpg" border="0"&gt;&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;Try to overwrite the file – see error:&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p style="padding-left:60px;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;&lt;a href="http://blogs.msdn.com/cfs-filesystemfile.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-83-23/0118.InterruptedBackup_5F00_Step6.jpg"&gt;&lt;img alt="" src="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-83-23/0118.InterruptedBackup_5F00_Step6.jpg" border="0"&gt;&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;Try to delete – see error:&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p style="padding-left:60px;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;&lt;a href="http://blogs.msdn.com/cfs-filesystemfile.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-83-23/5025.InterruptedBackup_5F00_Step7.jpg"&gt;&lt;img alt="" src="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-83-23/5025.InterruptedBackup_5F00_Step7.jpg" border="0"&gt;&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;span style="font-family:Calibri;font-size:small;"&gt;Run the PowerShell script again.&amp;nbsp; This time you should see that locked blob is identified, and after checking that it is not a restore lease, the lease is broken.&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p style="padding-left:60px;"&gt;&lt;span style="font-family:Calibri;font-size:small;"&gt;&lt;a href="http://blogs.msdn.com/cfs-filesystemfile.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-83-23/0724.InterruptedBackup_5F00_Step8.jpg"&gt;&lt;img alt="" src="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-83-23/0724.InterruptedBackup_5F00_Step8.jpg" border="0"&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;Try overwriting or deleting the file.&amp;nbsp; It should work! &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p style="padding-left:60px;"&gt;&lt;span style="font-family:Calibri;font-size:small;"&gt;&lt;/span&gt;&amp;nbsp;&lt;/p&gt;

&lt;p&gt;&lt;span style="font-family:Calibri;"&gt;&lt;span style="font-size:small;"&gt;Here are some ways you can enhance this script to automate this process:&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;Output the list of all blobs that are locked to a report (ex: excel file).&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;

&lt;li&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;Break the active leases and report out the list. &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;

&lt;li&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;Break the active leases and report out the list, but remove the filter for restore lease.&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;

&lt;li&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;Delete the blobs with active backup leases and report out the list.&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;span style="font-family:Calibri;font-size:small;"&gt;&lt;/span&gt;&amp;nbsp;&lt;/p&gt;

&lt;p&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Times New Roman;"&gt;NOTE: &lt;em&gt;If you are running PowerShell 2.0, you may have problems loading the Microsoft WindowsAzure.Storage.dll assembly. We recommend that you upgrade to Powershell 3.0 to solve the issue. You may also use the following workaround for PowerShell 2.0: &lt;/em&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Times New Roman;"&gt;Create or modify the powershell.exe.config file to load .NET 2.0 and .NET 4.0 assemblies at runtime with the following:&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p style="padding-left:30px;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;span style="font-family:Courier New;"&gt;&amp;lt;?xml version="1.0"?&amp;gt; &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p style="padding-left:30px;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;span style="font-family:Courier New;"&gt;&amp;lt;configuration&amp;gt; &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p style="padding-left:30px;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;span style="font-family:Courier New;"&gt;&amp;nbsp;&amp;lt;startup useLegacyV2RuntimeActivationPolicy="true"&amp;gt; &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p style="padding-left:30px;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;span style="font-family:Courier New;"&gt;&amp;nbsp;&amp;lt;supportedRuntime version="v4.0.30319"/&amp;gt; &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p style="padding-left:30px;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;span style="font-family:Courier New;"&gt;&amp;nbsp;&amp;lt;supportedRuntime version="v2.0.50727"/&amp;gt; &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p style="padding-left:30px;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;span style="font-family:Courier New;"&gt;&amp;nbsp;&amp;lt;/startup&amp;gt; &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p style="padding-left:30px;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;span style="font-family:Courier New;"&gt;&amp;lt;/configuration&amp;gt; &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;span style="font-family:Calibri;font-size:small;"&gt;For more information on best practices, see &lt;/span&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/jj919149.aspx"&gt;&lt;span style="font-family:Calibri;font-size:small;"&gt;SQL Server Backup and Restore Best Practices (Windows Azure Blob Storage Service)&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;span style="font-family:Calibri;font-size:small;"&gt;&lt;/span&gt;&amp;nbsp;&lt;/p&gt;
Originally posted at http://blogs.msdn.com/b/sqlosteam/</description></item><item><title>When will my SQL Server Evaluation Edition expire?</title><link>http://sqlblog.com/blogs/sqlos_team/archive/2013/02/17/when-will-my-sql-server-evaluation-edition-expire.aspx</link><pubDate>Mon, 18 Feb 2013 00:43:00 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:47775</guid><dc:creator>SQLOS Team</dc:creator><description>&lt;p&gt;&amp;nbsp;&lt;span style="color:#000000;font-size:small;"&gt;The &lt;a href="http://www.microsoft.com/en-us/download/details.aspx?id=29066"&gt;SQL Server Evaluation Edition&lt;/a&gt;&amp;nbsp;is a great way to&amp;nbsp;get a fully functional and free instance of SQL Server for learning and developing solutions. The edition has a built in expiry of 6 months from the time that you install it. I often install an Eval edition on a machine to set up a test or demo, and then 6 months later it comes as a complete surprise when it suddenly stops working.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:small;"&gt;Needless to say this can be&amp;nbsp;mildly inconvenient, as it typically expires on the day you plan to demo it. It would be nice to get some kind warning.&amp;nbsp;&lt;/span&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:small;"&gt;This problem&amp;nbsp;is exacerbated in the SQL Server&amp;nbsp;virtual machine&amp;nbsp;images in the Windows Azure gallery. While Azure VM's are in preview the SQL Server platform images are created with Evaluation edition, but the 6 month counter starts ticking&amp;nbsp;when the VM is created rather than when you deploy it. This came to a head recently as a few months went by&amp;nbsp;between platform image refreshes, so people deploying SQL VM images in Windows Azure were seeing them expire a few days later. See &lt;a href="http://social.msdn.microsoft.com/Forums/en-US/WAVirtualMachinesforSQLServer/thread/bd89b9c5-7f3c-4bb6-96c7-439a4f94c008"&gt;this thread&lt;/a&gt; for more details. Since then the SQL Server platform image has been refreshed so it won't be expiring for several months.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:small;"&gt;&lt;br /&gt;The problem with Azure VM's will go away soon as fully licensed pay-per-hour images will be available soon, and free trial offers will be available.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:small;"&gt;What happens when your&amp;nbsp;SQL instance does expire? What are the options? Particularly if you've developed a working solution and want to put it into production?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:small;"&gt;One option is to purchase a license and&amp;nbsp;enter the license key in &lt;span style="color:#0000ff;"&gt;SQL Server Installation Center-&amp;gt;Maintenance-&amp;gt;Upgrade License&lt;/span&gt;.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:small;"&gt;If you're using an Azure VM another option would be to migrate your application to a new VM.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:small;"&gt;One thing we've learned from this is&amp;nbsp;that as long as&amp;nbsp;time-bombed images are being used we need to be better at communicating and setting expectations about their expiration. &lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:small;"&gt;If you're running an Evaluation edition now, how can you tell when it's due to expire? One way is to run this query...&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&lt;span style="font-size:small;"&gt;sp_configure &lt;span style="color:#ff0000;font-family:Consolas;"&gt;&lt;span style="color:#ff0000;font-family:Consolas;"&gt;&lt;span style="color:#ff0000;font-family:Consolas;"&gt;'show advanced options'&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color:#808080;font-family:Consolas;"&gt;&lt;span style="color:#808080;font-family:Consolas;"&gt;&lt;span style="color:#808080;font-family:Consolas;"&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Consolas;"&gt;&lt;span style="font-family:Consolas;"&gt; 1&lt;/span&gt;&lt;/span&gt;&lt;span style="color:#808080;font-family:Consolas;"&gt;&lt;span style="color:#808080;font-family:Consolas;"&gt;&lt;span style="color:#808080;font-family:Consolas;"&gt;;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;RECONFIGURE&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#0000ff;font-size:small;"&gt;GO&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:small;"&gt;sp_configure &lt;span style="color:#ff0000;font-family:Consolas;"&gt;&lt;span style="color:#ff0000;font-family:Consolas;"&gt;&lt;span style="color:#ff0000;font-family:Consolas;"&gt;'Agent XPs'&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color:#808080;font-family:Consolas;"&gt;&lt;span style="color:#808080;font-family:Consolas;"&gt;&lt;span style="color:#808080;font-family:Consolas;"&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Consolas;"&gt;&lt;span style="font-family:Consolas;"&gt; 1&lt;/span&gt;&lt;/span&gt;&lt;span style="color:#808080;font-family:Consolas;"&gt;&lt;span style="color:#808080;font-family:Consolas;"&gt;&lt;span style="color:#808080;font-family:Consolas;"&gt;;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;RECONFIGURE&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#0000ff;font-size:small;"&gt;GO&lt;/span&gt;&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="color:#0000ff;"&gt;DECLARE&lt;/span&gt;&amp;nbsp;&lt;span style="color:#008080;font-family:Consolas;"&gt;&lt;span style="color:#008080;font-family:Consolas;"&gt;&lt;span style="color:#008080;font-family:Consolas;"&gt;@daysleft &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color:#0000ff;font-family:Consolas;"&gt;&lt;span style="color:#0000ff;font-family:Consolas;"&gt;&lt;span style="color:#0000ff;font-family:Consolas;"&gt;int&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;DECLARE&amp;nbsp;&lt;/span&gt;&lt;span style="color:#008080;font-family:Consolas;"&gt;&lt;span style="color:#008080;font-family:Consolas;"&gt;&lt;span style="color:#008080;font-family:Consolas;"&gt;@instancename &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color:#0000ff;font-family:Consolas;"&gt;&lt;span style="color:#0000ff;font-family:Consolas;"&gt;&lt;span style="color:#0000ff;font-family:Consolas;"&gt;sysname&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;SELECT&lt;/span&gt;&amp;nbsp;&lt;span style="color:#008080;font-family:Consolas;"&gt;&lt;span style="color:#008080;font-family:Consolas;"&gt;&lt;span style="color:#008080;font-family:Consolas;"&gt;@instancename &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color:#808080;font-family:Consolas;"&gt;&lt;span style="color:#808080;font-family:Consolas;"&gt;&lt;span style="color:#808080;font-family:Consolas;"&gt;= &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color:#ff00ff;font-family:Consolas;"&gt;&lt;span style="color:#ff00ff;font-family:Consolas;"&gt;&lt;span style="color:#ff00ff;font-family:Consolas;"&gt;CONVERT&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color:#808080;font-family:Consolas;"&gt;&lt;span style="color:#808080;font-family:Consolas;"&gt;&lt;span style="color:#808080;font-family:Consolas;"&gt;(&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color:#0000ff;font-family:Consolas;"&gt;&lt;span style="color:#0000ff;font-family:Consolas;"&gt;&lt;span style="color:#0000ff;font-family:Consolas;"&gt;sysname&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color:#808080;font-family:Consolas;"&gt;&lt;span style="color:#808080;font-family:Consolas;"&gt;&lt;span style="color:#808080;font-family:Consolas;"&gt;, &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color:#ff00ff;font-family:Consolas;"&gt;&lt;span style="color:#ff00ff;font-family:Consolas;"&gt;&lt;span style="color:#ff00ff;font-family:Consolas;"&gt;SERVERPROPERTY&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color:#808080;font-family:Consolas;"&gt;&lt;span style="color:#808080;font-family:Consolas;"&gt;&lt;span style="color:#808080;font-family:Consolas;"&gt;(&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color:#ff0000;font-family:Consolas;"&gt;&lt;span style="color:#ff0000;font-family:Consolas;"&gt;&lt;span style="color:#ff0000;font-family:Consolas;"&gt;'InstanceName'&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color:#808080;font-family:Consolas;"&gt;&lt;span style="color:#808080;font-family:Consolas;"&gt;&lt;span style="color:#808080;font-family:Consolas;"&gt;))&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;EXEC&lt;/span&gt;&amp;nbsp;&lt;span style="color:#008080;font-family:Consolas;"&gt;&lt;span style="color:#008080;font-family:Consolas;"&gt;&lt;span style="color:#008080;font-family:Consolas;"&gt;@daysleft &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color:#808080;font-family:Consolas;"&gt;&lt;span style="color:#808080;font-family:Consolas;"&gt;&lt;span style="color:#808080;font-family:Consolas;"&gt;= &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color:#800000;font-family:Consolas;"&gt;&lt;span style="color:#800000;font-family:Consolas;"&gt;&lt;span style="color:#800000;font-family:Consolas;"&gt;xp_qv &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color:#ff0000;font-family:Consolas;"&gt;&lt;span style="color:#ff0000;font-family:Consolas;"&gt;&lt;span style="color:#ff0000;font-family:Consolas;"&gt;'2715127595'&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color:#808080;font-family:Consolas;"&gt;&lt;span style="color:#808080;font-family:Consolas;"&gt;&lt;span style="color:#808080;font-family:Consolas;"&gt;, &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color:#008080;font-family:Consolas;"&gt;&lt;span style="color:#008080;font-family:Consolas;"&gt;&lt;span style="color:#008080;font-family:Consolas;"&gt;@instancename&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;SELECT&lt;/span&gt;&amp;nbsp;&lt;span style="color:#008080;font-family:Consolas;"&gt;&lt;span style="color:#008080;font-family:Consolas;"&gt;&lt;span style="color:#008080;font-family:Consolas;"&gt;@daysleft &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color:#ff0000;font-family:Consolas;"&gt;&lt;span style="color:#ff0000;font-family:Consolas;"&gt;&lt;span style="color:#ff0000;font-family:Consolas;"&gt;'Number of days left'&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&lt;span style="color:#0000ff;font-size:small;"&gt;GO&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:small;"&gt;&lt;br /&gt;That will give you an&amp;nbsp;answer in days until expiry. As of today,&amp;nbsp;the SQL Server gallery image I&amp;nbsp;launched a few days ago has 122 days left, which gives me a few months to&amp;nbsp;do my&amp;nbsp;demos and then forget that it's going to expire. Hopefully by that time I'll have either upgraded it&amp;nbsp;or started with a refreshed or pay per hour image.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:small;"&gt;- Guy&lt;/span&gt;&lt;/p&gt;
Originally posted at http://blogs.msdn.com/b/sqlosteam/</description></item></channel></rss>