title: Move SQL Server 2008 R2 database files to a new folder location
body: <p>Currently i have a list of databases i wish to move on the current server. </p>
  
  <p>DATA:</p>
  
  <p>Current Path: Drive:\MSSQL\DATA\FOLDER</p>
  
  <p>New Path: Drive:\MSSQL\DATA</p>
  
  <p>LOGS:</p>
  
  <p>Current Path: Drive:\MYSSQL\LOGS\FOLDER</p>
  
  <p>New Path: Drive:\MYSSQL\LOGS</p>
  
  <p>Is there a SQL script that can be used to set offline multiple databases, detactch them and attach them to the new location? This is also a production enviroment and are pretty large databases (a backup and restore would take much longer). In total 9 databases need to be moved, is this a simple procedure aslong as the location and user have required permissions? Thank you for any help.</p>