none
Help to attach database

    Question

  • I'm trying to attach the "Northwind Database" to SQL Server 2012, but I keep getting the error message " this is not a primary database. How do I correct this problem?
    Monday, May 06, 2013 3:33 PM

Answers

  • Remove the log file from the location where mdf file exists. Log file will be built automatically. very you have sufficient access/write permissions to the folder where you kept mdf file

    Thanks, Rajendra

    Monday, May 06, 2013 4:08 PM
  • use the script file and not the bak here:

    http://northwinddatabase.codeplex.com/releases/view/71634

    use this link: Northwind.sql.zip

    *If you want to run this script on SQL 2012, change these two lines

    exec sp_dboption 'Northwind','trunc. log on chkpt.','true'

    exec sp_dboption 'Northwind','select into/bulkcopy','true'

    Into

    ALTER DATABASE NORTHWIND SET RECOVERY SIMPLE


    signature

    Thursday, May 09, 2013 11:22 PM

All replies

  • Remove the log file from the location where mdf file exists. Log file will be built automatically. very you have sufficient access/write permissions to the folder where you kept mdf file

    Thanks, Rajendra

    Monday, May 06, 2013 4:08 PM
  • use the script file and not the bak here:

    http://northwinddatabase.codeplex.com/releases/view/71634

    use this link: Northwind.sql.zip

    *If you want to run this script on SQL 2012, change these two lines

    exec sp_dboption 'Northwind','trunc. log on chkpt.','true'

    exec sp_dboption 'Northwind','select into/bulkcopy','true'

    Into

    ALTER DATABASE NORTHWIND SET RECOVERY SIMPLE


    signature

    Thursday, May 09, 2013 11:22 PM