Sql-server – HeidiSQL, attach/register database in MSSQL server

database-administrationsqlsql server

How to attach (or register) an existing MSSQL database to a server Using HeidiSQL

Best Answer

You can always do this with a query:

CREATE DATABASE [YourDB] ON ( FILENAME = N'd:\path\to\YourDB.mdf' ),( FILENAME = N'd:\path\to\YourDB_log.ldf' ) FOR ATTACH

or

EXEC sp_attach_db @dbname = N'YourDB', 
    @filename1 = 
N'd:\path\to\YourDB.mdf', 
    @filename2 = 
N'd:\path\to\YourDB_log.ldf';