1

I am using Sql Server InMemory OLTP for Asp.Net application to store session data in Sql Server using this link

After that i found one error like need to create file group for the database which i used for InMemory OLTP. I was able to create the file group for my existing database. After that need to add file, For that i have tried below Query:

ALTER DATABASE imoltp ADD FILE (
    name='imoltp_mod1', filename='c:\data\imoltp_mod1')
    TO FILEGROUP imoltp_mod;

But when i run above query i am getting below error:

Msg 5121, Level 16, State 2, Line 1
The path specified by "c:\Data\imoltp_mod1" is not in a valid directory.
Msg 5009, Level 16, State 14, Line 1
One or more files listed in the statement could not be found or could not be initialized.

in this path i created "Data" folder, Or even tried to change the drive from C to D but still getting the same error. I have also created new database as per this link provided solution. But stil stuck in same query.

I have here few question related to session store in DB.

When i provided DB name in session membership provider related connnectionstring, Will it create table dynamically, If yes then what could be the name of table?

Please suggest.

Thom A
  • 88,727
  • 11
  • 45
  • 75
V.Prasad
  • 131
  • 4
  • 19
  • Does the SQL Server service account have access to said directory? – Thom A Aug 26 '20 at 08:23
  • @PatrickBeynio Windows file paths are *not* case sensitive. Certainly they are in other operating systems, like Unix, but not in Windows. – Thom A Aug 26 '20 at 08:29
  • @Larnu, You are right Windows directory drive name is not case sensitive, I changed c to C but still getting the same error. How to find Sql Server service account to verify about access is present for the provided path? – V.Prasad Aug 26 '20 at 08:40
  • Check the SQL Server Configuration Manager on the Instance Host; it'll tell you the account that the Service is running under. Then check the permissions of the directory, again on the instance's host, to see if it has access. – Thom A Aug 26 '20 at 08:42
  • Hi Larnu, I found the issue as you suggested as this issue was more related to the permisssion, Once i changed permission to NT Service then i found like the specific file is creating under path. – V.Prasad Aug 26 '20 at 10:27
  • @Larnu, My issue was resolve yesterday, solution provided by you. Please comment in answer so i can upvote you and close this ticket. – V.Prasad Aug 27 '20 at 12:23

1 Answers1

0

I also had this error. Then I realized that the c:\data\ folder has to be created on the server and not my own developer machine.

Arpi
  • 244
  • 3
  • 10