February 23, 2011 at 7:37 pm
So this query comes straight out of the book... but in my instance of SQL server 2008,
it throws thes errors...
So I am thinking there may be something wrong with my server configurations?..Althought I have followed each step in the book when configuring everything... I just dont know what/where to check to see what may be wrong with my SQL server instance...
---------------------------------------------------
CREATE DATABASE TK432 ON PRIMARY
(Name = N'TK432_Data' , FILENAME = N'c:\test]TK432.mdf',
SIZE = 8MB , MAXSIZE = UNLIMITED , FILEGROWTH = 16MB),
FILEGROUP FG1
(NAME = N'TK432_Data2', FILENAME = N'c:\test\TK432.ndf',
SIZE = 8MB , MAXSIZE = UNLIMITED, FILEGROWTH = 16MB),
FILEGROUP Documents CONTAINS FILESTREAM DEFAULT
(NAME = N'Documents' , FILENAME = 'N c:\test\Tk432Documents')
LOG ON
(NAME = N'TK432_Log', FILENAME = N'c:\test\TK432.ldf' ,
SIZE = 8MB , MAXSIZE = 2048GB , FILEGROWTH = 16MB)
GO
ALTER DATABASE TK432
MODIFY FILEGROUP FG1
DEFAULT
GO
---error messages---
Msg 5133, Level 16, State 1, Line 2
Directory lookup for the file "c:\test\TK432.ndf" failed with the operating system error 2(The system cannot find the file specified.).
Msg 1802, Level 16, State 1, Line 2
CREATE DATABASE failed. Some file names listed could not be created. Check related errors.
Msg 911, Level 16, State 1, Line 2
Database 'TK432' does not exist. Make sure that the name is entered correctly.
February 24, 2011 at 1:13 am
Have you double checked your paths specified above? There are a couple of typos in this script..
__________________________
Allzu viel ist ungesund...
February 24, 2011 at 6:24 pm
I had a second look.. looking at things with fresh eyes help..
Im pretty sure i got all the typos out of the code..
but I am still getting an error... it tells me it cant find the file, because I cant create the database...
and im not sure what I need to do..
CREATE DATABASE TK432 ON PRIMARY
(Name = N'TK432_Data' , FILENAME = N'c:\test\TK432.mdf',
SIZE = 8MB , MAXSIZE = UNLIMITED , FILEGROWTH = 16MB),
FILEGROUP FG1
(NAME = N'TK432_Data2', FILENAME = N'c:\test\TK432.ndf',
SIZE = 8MB , MAXSIZE = UNLIMITED , FILEGROWTH = 16MB),
FILEGROUP Documents CONTAINS FILESTREAM DEFAULT
(NAME = N'Documents' , FILENAME = N'c:\test\TK432Documents')
LOG ON
(NAME = N'TK432_Log', FILENAME = N'c:\test\TK432.ldf' ,
SIZE = 8MB , MAXSIZE = 2048GB , FILEGROWTH = 16MB)
GO
ALTER DATABASE TK432
MODIFY FILEGROUP FG1
DEFAULT
GO
errors:
Msg 5133, Level 16, State 1, Line 1
Directory lookup for the file "c:\test\TK432.mdf" failed with the operating system error 2(The system cannot find the file specified.).
Msg 1802, Level 16, State 1, Line 1
CREATE DATABASE failed. Some file names listed could not be created. Check related errors.
Msg 911, Level 16, State 1, Line 2
Database 'TK432' does not exist. Make sure that the name is entered correctly.
February 25, 2011 at 4:09 am
Does c:\test\ exist at all?
__________________________
Allzu viel ist ungesund...
February 26, 2011 at 8:08 am
So this query comes straight out of the book... but in my instance of SQL server 2008,
it throws thes errors...
So I am thinking there may be something wrong with my server configurations?..Althought I have followed each step in the book when configuring everything... I just dont know what/where to check to see what may be wrong with my SQL server instance...
The first question is file stream enabled in your installation because if it is not then you need to go into Configuration Manager and enable it before you run that code again. The second is SQL Server installed in your C drive? The code maybe right but the path relative to your box maybe wrong that is the reason for the errors. So go to C programs then Microsoft SQL Server and then the relational engine folder, then the data subfolder copy the path so you can correct the path SQL Server expect in you local box to create the database.
Kind regards,
Gift Peddie
February 26, 2011 at 8:53 am
Filestream has to be enabled in SQL SErver (sp_configure) and also in Configuration Manager, as a note to the OS that this is allowed. So two settings to change.
Then check your pathing, as suggested above.
http://www.sqlservercentral.com/articles/SQL+Server+2008/64088/
February 26, 2011 at 1:19 pm
Ok i tried this out:
http://www.sqlservercentral.com/articles/SQL+Server+2008/64088/
but this code from the tutorial:
USE MASTER
GO
EXEC sp_FILESTREAM_configure @enable_level = 2
gave me this error:
Msg 2812, Level 16, State 62, Line 2
Could not find stored procedure 'sp_FILESTREAM_configure'.
so i searched this:
How to enable FILESTREAM-
http://msdn.microsoft.com/en-us/library/cc645923.aspx
i followed the steps.. and FILESTREAM was already enabled on my SQL server..
then i ran this code :
EXEC sp_configure filestream_access_level, 2
RECONFIGURE
got this output:
Configuration option 'filestream access level' changed from 2 to 2. Run the RECONFIGURE
This is the path of my SQL server...
C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL
and I did check in C:\ and there is no 'test' folder...
so do i need to create a 'test' folder manually, then go back into SQL Server and retry the query?
because the book says that query code :
".... you create a database with multiple files that is enabled for FILESTREAM storage..
...Execute the following code to create a databse..."
and that is the query listed above...
so that code should create the 'test' folder correct?
or should i make the path in the query code
' C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\test\TK432.mdf '
??
February 27, 2011 at 10:23 am
Did you add a filegroup for your database that includes filestream data? If you look at the database creation script in the article, you will see (emphasis mine):
USE MASTER
GO
CREATE DATABASE TEST_DB ON PRIMARY
( NAME = TEST_DB_data,
FILENAME = N’C:\ TEST_DB_data.mdf’),
FILEGROUP FG_1
( NAME = TEST_DB_REGULAR,
FILENAME = N’C:\ TEST_DB_data_1.ndf’),
FILEGROUP FG_2 CONTAINS FILESTREAM
( NAME = FS_FILESTREAM,
FILENAME = N’C:\TEST_FS’)
LOG ON
( NAME = FS_LOG,
FILENAME = N’C:\TEST_FS_log.ldf’);
GO
I believe this creates your filestream data folder. Once this is done, and you create a table that has a column set for filestream and add data, it ought to be added to your file system.
February 27, 2011 at 12:26 pm
Yes, you have to manually create the c:\test folder on your computer. The TK432Documents subfolder will be created when you run the code from the book.
Viewing 9 posts - 1 through 8 (of 8 total)
You must be logged in to reply to this topic. Login to reply