[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

select file path

Posted on 2009-12-22
7
Medium Priority
?
1,275 Views
Last Modified: 2012-05-08
ERROR -
Msg 5592, Level 16, State 3, Procedure FileAdd, Line 20
FILESTREAM feature doesn't have file system access enabled.

Suggest SOLUTION
drop TABLE [dbo].[tbl_Files]
go
CREATE TABLE [dbo].[tbl_Files](
[Id] [uniqueidentifier] ROWGUIDCOL NOT NULL primary key,
[SystemNumber] [int] NOT NULL,
[SystemFile] [varbinary](max) FILESTREAM NULL,
[FileType] [varchar](5) NULL
) ON [PRIMARY] FILESTREAM_ON [fg]

GO
drop PROCEDURE [dbo].[FileAdd]
go
CREATE PROCEDURE [dbo].[FileAdd]
@SystemNumber int,
@FileType varchar(5),
@filepath varchar(max) output
AS
BEGIN
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	SET NOCOUNT ON;

    DECLARE @ID UNIQUEIDENTIFIER
	SET @ID = NEWID()

	INSERT INTO [dbo].[tbl_Files]
	([Id],[SystemNumber],SystemFile,FileType)
	VALUES (@ID ,@SystemNumber,CAST('' AS VARBINARY(MAX)),@FileType)
	

	select @filepath = SystemFile.PathName() from tbl_Files where Id = @ID

END

Open in new window

0
Comment
Question by:ajaygund
  • 3
  • 3
6 Comments
 
LVL 57

Expert Comment

by:Raja Jegan R
ID: 26103970
Kindly enable Filestream access as per the link below to get it work..

http://www.mssqltips.com/tip.asp?tip=1838
0
 

Author Comment

by:ajaygund
ID: 26111386
This setting is alrady done. but  still same error
0
 
LVL 57

Accepted Solution

by:
Raja Jegan R earned 750 total points
ID: 26114251
The login from which you are trying need to have either sysadmin or serveradmin privileges..
Kindly confirm whether you have it because your error message says so.

kindly run this again:

USE master
Go
EXEC sp_configure 'show advanced options'
GO
EXEC sp_configure filestream_access_level, 2
GO
RECONFIGURE WITH OVERRIDE
GO
0
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

 

Author Comment

by:ajaygund
ID: 26117318
This SP "EXEC sp_configure filestream_access_level, 2" is already executed
with
RECONFIGURE WITH OVERRIDE
0
 
LVL 57

Expert Comment

by:Raja Jegan R
ID: 26120022
Kindly confirm whether you are at SQL Server 2008 SP1 or not.
0
 

Author Closing Comment

by:ajaygund
ID: 31668942
ok
0

Featured Post

Configuration Guide and Best Practices

Read the guide to learn how to orchestrate Data ONTAP, create application-consistent backups and enable fast recovery from NetApp storage snapshots. Version 9.5 also contains performance and scalability enhancements to meet the needs of the largest enterprise environments.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
This shares a stored procedure to retrieve permissions for a given user on the current database or across all databases on a server.
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.
Suggested Courses

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question