Tuesday, March 16, 2010

SQL : Attached a mdf file (without log file)

Yep, i have a mdf file (from sample code) that i need to attach to my SQL Svr 05, but i cant as i do not have log file,
seems the easiest way to settle this is by this SQL command:-


USE [master]
GO
CREATE DATABASE [pagingTest] ON
( FILENAME = N'g:\SampleCode\CustomPaging\GridView Paging\App_Data\Database.mdf' )
FOR ATTACH
GO



No comments: