Cannot Bind Northwind Database to SQL Server 2008 R2

When I try to get the following error in SQL Server Management Studio:

TITLE: Microsoft SQL Server Management Studio

Database connection error for AHAKEEM server. (Microsoft.SqlServer.Smo)

ADDITIONAL INFORMATION:

An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)

Cannot open the physical file "C: \ SQL Server 2000 Sample Databases \ northwnd.mdf". Operating system error 5: "5 (could not get text for this error. Reason: 15105)." (Microsoft SQL Server, Error: 5120)

This is a new version Northwinds mdf, which appeared only from the Microsoft installer.

+5
source share
3

5120 - , . SQL Management Studio , db .

+8

, mdf ldf, ldf :

1.

EXECUTE sp_attach_single_file_db @dbname = 'SAMPLEDB',
@physname = N'D:\MSSQL\DATA\SAMPLEDB.mdf' 
GO

2. , .

CREATE DATABASE SAMPLEDB ON
(FILENAME = N'D:\MSSQL\DATA\SAMPLEDB.mdf')
FOR ATTACH_REBUILD_LOG
GO 

3: , .

CREATE DATABASE SAMPLEDB ON
( FILENAME = N'D:\MSSQL\DATA\SAMPLEDB.mdf')
FOR ATTACH
GO
0

Northwind pubs SQL Server 2000 SQL Server 2014 , .

Sample Database SQL Server 2014:

  • , , SQL Server 2014 Management Studio. SQL Server .
  • > . instnwnd.sql . . SQL script . "" . , :

sp_dboption.

  • 20 :

exec sp_dboption 'Northwind', 'trunc. log on chkpt. ',' true 'exec sp_dboption "Northwind", "select into/bulkcopy", "true"

  • Replace them with this line as shown below:

change database Northwind recovery utility is simple

To attach the pubs database, repeat step 2 above and this time open the instpubs.sql file . Replace sp_dboption as before:

Pubs database change is easy to install

  • It remains only to run the script, so click on Run in both scripts.

Note. The default folder location for your selection is: "C: \ SQL Server 2000 Sample Databases"

0
source

All Articles