Getting Started with Adobe After Effects - Part 6: Motion Blur


Upload Image Close it
Select File

My Experiments with SQLServer
Browse by Tags · View All
SQLServer 126
SQLServer 2008 R2 91
SQLServer 2008 86
SQLServer 2005 82
SQL 60
Database 59
Sql And Me 57
Tips & Tricks 28
SQL Server 27
SQL FAQ 26

Archive · View All
May 2011 25
June 2011 21
July 2011 21
August 2011 19
April 2011 16
January 2013 4
May 2012 3
April 2012 3
October 2011 3
February 2013 2

Vishal Gajjar's Blog

Attach a single MDF file – Database

Apr 29 2011 8:07AM by Vishal Gajjar   

If you want to attach a database to a SQL Instance you need both the data file (.mdf) and the log file (.ldf). Without both files you cannot attach a database. Let’s try doing that…

To attach a database from Management Studio:

Right click on Database node and choose attach:

This will open the “Attach Databases” dialogue box, where you can select the .mdf file using “Add…” button:

Note, that is says “Not Found” for log file, if you click on “OK”, it will raise an error:

The detailed error message can be seen by click on “Message” link:

Moral of the story, you can’t attach single .mdf using GUI. You need to use T-SQL to achieve this:

– © 2011 – Vishal (http://SqlAndMe.com)
 
CREATE DATABASE [TestDB]
ON (FILENAME = 'C:\123\TestDB.mdf')
FOR ATTACH_REBUILD_LOG ;

On successful completion, you will get the below message:

File activation failure. The physical file name “C:\Program Files\Microsoft SQL Server\MSSQL11.DENALI\MSSQL\DATA\TestDB_1.ldf” may be incorrect.
New log file 'C:\123\TestDB_log.ldf' was created.

Hope This Helps! Cheers!


Republished from Sql&Me [31 clicks].  Read the original version here [32134 clicks].

Vishal Gajjar
46 · 4% · 1276
0
Liked
 
0
Lifesaver
 
0
Refreshed
 
0
Learned
 
0
Incorrect



Submit

Your Comment


Sign Up or Login to post a comment.

    Copyright © Rivera Informatic Private Ltd Contact us      Privacy Policy      Terms of use      Report Abuse      Advertising      [ZULU1097]