SqlServerDrive

Saturday, August 10, 2013

How do you attach a mdf data file without a log file?

Make sure copy the .mdf data file into a folder where you will attach database. in my example I have copied under C:\data folder and run the following script.

CREATE DATABASE [AdventureWorksDW2012] ON 
( FILENAME = N'C:\Data\AdventureWorksDW2012_Data.mdf' )
 FOR ATTACH_REBUILD_LOG
GO

Posted by Hari Prasad Ere Tech Blog at 6:48 PM
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest

No comments:

Post a Comment

Newer Post Older Post Home
Subscribe to: Post Comments (Atom)

About Me

Hari Prasad Ere Tech Blog
View my complete profile

Blog Archive

  • ►  2015 (2)
    • ►  March (1)
    • ►  February (1)
  • ►  2014 (3)
    • ►  March (2)
    • ►  January (1)
  • ▼  2013 (14)
    • ►  September (1)
    • ▼  August (11)
      • Renaming the database
      • How to rebuild or Restore corrupted master database?
      • Blocking Locks and Deadlocks
      • How do you attach a mdf data file without a log f...
      • Return SQLResult set into a HTML format.(Microsoft...
      • Contained Databases
      • Do you backup tempdb database?
      • How do you create a database in sql server?
      • How many file groups does database contains?
      • why you need to install more than one instance of ...
      • How many SQLserver instance can own on a single ma...
    • ►  July (1)
    • ►  February (1)
  • ►  2012 (3)
    • ►  May (1)
    • ►  April (1)
    • ►  February (1)
Simple theme. Powered by Blogger.