Labels

ASP.NET (1) Data Model (1) Django (1) MDX (15) Python (3) Redshift (3) SSAS (15) SSRS (3) T-SQL (29)

Thursday, 27 September 2012

Attach MDF file to a Database

Below is the query to attach MDF file to a database:


CREATE DATABASE AdventureWorks2008DWR2 ON
( FILENAME = N'C:\Users\mvaradhan\Downloads\AdventureWorksDW2008R2.mdf')
FOR ATTACH
GO

Attaching MDF file to a Database

Below is the query to attach mdf file to a database:


CREATE DATABASE AdventureWorks2008DWR2 ON
( FILENAME = N'C:\Users\mvaradhan\Downloads\AdventureWorksDW2008R2.mdf')
FOR ATTACH
GO

Wednesday, 26 September 2012

Attaching .MDF file to a Database


Below is the script to attach AdventureWorks.mdf file to a newly created database:


CREATE DATABASE AdventureWorks2008DWR2 ON
( FILENAME = N'C:\Users\mvaradhan\Downloads\AdventureWorksDW2008R2.mdf')
FOR ATTACH
GO