Created
March 14, 2024 00:17
-
-
Save apandrade/d2a2f1641af0762bea7ed3557113992b to your computer and use it in GitHub Desktop.
Create Database from .mdf file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
USE [master] | |
GO | |
CREATE DATABASE [database_name] ON | |
( FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\Data\<database name>.mdf' ), | |
( FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\Data\<database name>.ldf' ) | |
FOR ATTACH ; | |
GO |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment