Can not copy some SQL server files -


I have attached some databases for my SQL server instance. I think of different behaviors, while DB Has been added in the same way.

When I try to copy the folder containing the files, then some files do not copy and give the error, while that file is in use, some other, with the same example Is connected and in the same folder, copy without problems. Please note what is the difference?

Thanks

The correct way to copy files are as follows, it is only user database Applies to:

To transfer data or log file as part of a planned restore, follow these steps:

  1. Run the following
  2. Optional database database_name set offline
  3. Move the file or file to the new location.
  4. To move each file, run the following statement.
  5. Alternate database database_name modified file (NAME = logical_name, FILENAME = 'new_path \ os_file_name');
  6. Run the following statement
  7. ALTER DATABASE database_name SET ONLINE;
  8. Confirm the file change by running the following query.
  9. SELECT name, Physical_name as the current location, state_desc from sysmaster_files

Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -