How to attach a SQL Server database from the command line

前端 未结 3 636
梦毁少年i
梦毁少年i 2021-01-12 03:47

Is it possible to enter a command line command (like in a batch file) to attach a detached database to SQL Server, in stead of opening the management studio and doing it in

3条回答
  •  余生分开走
    2021-01-12 04:17

    Small gotcha, it won't tell you what is wrong when using sqlcmd and your mdf/ldf files are marked read-only. Make sure they are read-write.

提交回复
热议问题