0

how to fix this issue?

An attempt to attach an auto-named database for file C:\Users\Rozky\Desktop\PayrollSystem - Copy\PayrollSystem\Payroll.mdf failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share.

  • have you tried renaming the database? – Sim1 Mar 10 '15 at 09:54
  • possible duplicate of [Attempt to attach an auto-named database for .mdf file failed](http://stackoverflow.com/questions/8747673/attempt-to-attach-an-auto-named-database-for-mdf-file-failed) – stuartd Mar 10 '15 at 09:55

1 Answers1

0

You are attemting to insert the database with the same name, if u want to attach the database there are two ways u can do that

  1. You can simple detach the database and attach it again
  2. Change the name of databse something different, for example if your databse name is abc you can change it to abcold or oldabc or whtever, then it will attach easily, and be sure to open sql server as administrator
Oliver james
  • 162
  • 11