Failed to connect the AdventureWorks2008 trial database to a named instance in SQL Server 2008

First of all, the Northwind and AdventureWorksDW2008 databases are attached without problems, but AdventureWorks2008 fails with the following error.

//Msg 5120, Level 16, State 105, Line 1
 Unable to open the physical file 
"C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\DATA\Documents".
 Operating system error 2: "2(The system cannot find the file specified.)".
 Msg 5105, Level 16, State 14, Line 1
 A file activation error occurred. The physical file name 
 'C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\DATA\Documents' 
 may be incorrect. Diagnose and correct additional errors, and retry the operation.
 Msg 1813, Level 16, State 2, Line 1
 Could not open new database 'AdventureWorks2008'. CREATE DATABASE is aborted.

I did not use the default database instance "MSSQLSERVER" during installation.

So where does he find this path "C: ... \ MSSQL10.MSSQLSERVER ... \ Documents"?

+3
source share
10 answers

go to sql server SQL Server configuration configurator (MSSQLSERVER) change "log on" to "local system"

+2
source

FILESTREAM:

EXEC sp_configure filestream_access_level, 2
RECONFIGURE

:

USE [master]
GO
CREATE DATABASE [AdventureWorks2008] ON 
( FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL10.SQLTRAININGKIT\MSSQL\DATA\AdventureWorks2008_Data.mdf' ),
( FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL10.SQLTRAININGKIT\MSSQL\DATA\AdventureWorks2008_Log.ldf' ),
FILEGROUP [PRIMARY] CONTAINS FILESTREAM DEFAULT 
( NAME = N'Documents', FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL10.SQLTRAININGKIT\MSSQL\DATA\Documents' )
FOR ATTACH
GO

TRAININGKIT sysadmin.

+1

SQL2008R2:

  • ""
  • MSSQL Mgmt Studio ( Admin)
  • ( Srv/Advanced)
  • db AdventureWorks2008R2.mdf( db )
+1

, SQL Guy! FILESTREAM = > services = > yourinstance = > right-click = > properties = > advanced,   ( sql = > attach...). !

+1

, SQL. SQL Log :

FILESTREAM 'placeholder.txt' '\?\C:\Program Files\Microsoft SQL \MSSQL10.MSSQLSERVER\MSSQL\DATA\Documents\$FSLOG '.

, , ( ):

  • SQL MDF LDF Documents DATA.

  • C:\Program Files\Microsoft SQL \MSSQL10.MSSQLSERVER\MSSQL\DATA\Documents\$FSLOG\placeholder.txt(R2 BOL , ).

  • CREATE DATABASE [AdventureWorks2008] (FILENAME =     N'C:\Program Files\Microsoft SQL      \MSSQL10.MSSQLSERVER\MSSQL\DATA\AdventureWorks2008_Data.mdf"     ), (FILENAME = N'C:\Program Files\Microsoft SQL      \MSSQL10.MSSQLSERVER\MSSQL\DATA\AdventureWorks2008_Log.ldf ')     , FILEGROUP [PRIMARY] FILESTREAM DEFAULT (NAME =     N'Documents ', FILENAME = N'C:\Program Files\Microsoft SQL      \MSSQL10.MSSQLSERVER\MSSQL\DATA\Documents ')     FOR ATTACH_REBUILD_LOG

+1

:

. .mdf .ldf, , , mdf, .ldf , mdf. , db D:\ E: \, db . .

:

Windows Authentication
SQL Server ( , " " )

+1

:

- SQL Server 2008 Express R2, Windows Vista, Adventureworks2008R2.mdf

  • Program files(X86)\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\DATA ( )
  • . Windows Vista SQL SERVER Express 2008R2. Adventureworks2008R2.mdf.
  • --- SSMS ATTACH DIALOGUE BOX ( "" box), (.ldf ). , .
  • - . .
0

. ( ) 'AdventureWorks 2008R2 OLTP Script'

instawdb.sql script. script. script. . !

0

In my case, the problem was with the file I used and with the version of SQL. I installed SQLServer2008R2, and the file I used was AdventureWorks2008_Data.mdf. I downloaded it from here http://msftdbprodsamples.codeplex.com/releases/view/59211 (AdventureWorks2008R2_Data.mdf), and now everything is fine.

0
source

Source: https://habr.com/ru/post/1750018/


All Articles