title: Create SQL Server 2008 R2 database Backup and Restore it on SQL Server 2012
body: <p>I am trying to restore a databse from .bak file (created from sql server 2008 r2 express edition) to sql server 2012 express edition.
  I right click on the new databse I have created on sql server2012 database. Click on Tasks -> Restore -> Database. On Restore Database window I select 'Device' radio button. Upon clicking 'Select backup devices' and Selecting 'aaa.bak' file from 'Locate backup file' window when I click on 'Add' I get the following exception. I tried searching on different blogs but couldn't find anything remotely close to something that would solve this problem or at least help me find out what the exception is about - </p>
  
  <pre><code>===================================
  
  An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)
  
  ------------------------------
  Program Location:
  
     at Microsoft.SqlServer.Management.Common.ServerConnection.GetExecuteReader(SqlCommand command)
     at Microsoft.SqlServer.Management.Common.ServerConnection.ExecuteReader(String sqlCommand, SqlCommand&amp; command)
     at Microsoft.SqlServer.Management.SqlMgmt.BrowseFolderEx.IsPathExisting(String path, Nullable`1&amp; isFolder)
     at Microsoft.SqlServer.Management.SqlMgmt.BrowseFolderEx.HandleFileNamePaths(String filePath)
     at Microsoft.SqlServer.Management.SqlMgmt.BrowseFolderEx.OnOK(Object sender, EventArgs e)
     at System.Windows.Forms.Control.OnClick(EventArgs e)
     at System.Windows.Forms.Button.OnClick(EventArgs e)
     at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
     at System.Windows.Forms.Control.WmMouseUp(Message&amp; m, MouseButtons button, Int32 clicks)
     at System.Windows.Forms.Control.WndProc(Message&amp; m)
     at System.Windows.Forms.ButtonBase.WndProc(Message&amp; m)
     at System.Windows.Forms.Button.WndProc(Message&amp; m)
     at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message&amp; m)
     at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message&amp; m)
     at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
     at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG&amp; msg)
     at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
     at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
     at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
     at System.Windows.Forms.Application.RunDialog(Form form)
     at System.Windows.Forms.Form.ShowDialog(IWin32Window owner)
     at System.Windows.Forms.Form.ShowDialog()
     at Microsoft.SqlServer.Management.SqlManagerUI.SqlRestoreSelectBackupSource.AddFile()
     at Microsoft.SqlServer.Management.SqlManagerUI.SqlRestoreSelectBackupSource.buttonAdd_Click(Object sender, EventArgs e)
  
  ===================================
  
  Incorrect syntax near 's'.
  Unclosed quotation mark after the character string ''. (.Net SqlClient Data Provider)
  
  ------------------------------
  For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft%20SQL%20Server&amp;ProdVer=11.00.5058&amp;EvtSrc=MSSQLServer&amp;EvtID=102&amp;LinkId=20476
  
  ------------------------------
  Server Name: xxx
  Error Number: 102
  Severity: 15
  State: 1
  Line Number: 1
  
  
  ------------------------------
  Program Location:
  
     at Microsoft.SqlServer.Management.Common.ConnectionManager.ExecuteTSql(ExecuteTSqlAction action, Object execObject, DataSet fillDataSet, Boolean catchException)
     at Microsoft.SqlServer.Management.Common.ServerConnection.GetExecuteReader(SqlCommand command)
  </code></pre>