I was trying to copy my database to my local SQL Server. I detached it using SQL Server Management Studio, and now I cannot attach it. I don’t have the back file, but I know the database is still on the server. Does anyone know how to find the database files on the server so I can attach my database again?
Replying to my own question just in case this is helpful to someone in the future. Whatever you do, do not detach your database when using SSMS! On a shared server like GearHost there’s no way to attach your database. If that happens to you make sure you have a backup MDF file, and use the GearHost portal to create a new database and restore from your local backup file. Thankfully in my case despite my blunder, the engineers at GearHost were able to restore my database for me! Thank you GearHost! From now on I will make a local backup first before trying anything like what I did earlier.
you can save script for database and execute it on another one or save it
open script you’r save it from your database
and exexute it in another database with the same name