Creating SQL Server Login From A Domain Account To Access System Directory
I was having a problem accessing a folder via an extended procedure. The extended procedure accepts a DirectoryInfo variable (File Path) and it returns the File Size and File Count within the folder (much like right-clicking a folder and choosing the “Properties” from the context menu). I need the info to monitor the file size of specific folders for a SSRS report.
Executing the extended procedure causes the SQL Server to throw the following error:
The SQL Server Error Log translates this to be a “EXCEPTION_ACCESS_VIOLATION”. Switching to Windows Authentication would not solve the problem. I could not really drill down to the error because it is apparent that this is a Windows Operating System error. My lack of familiarity with the network environment makes it hard for me to investigate the error. The Windows Event Viewer could not give me useful information pertaining to the error. I do not want to tweak the access rules on the folders that my extended procedure needs in fear of opening holes of vulnerability (these folders are being used by a ASP.NET Web application for file storage).
To circumvent a possible security violation and to keep the security compliance intact, I decided to map the Domain Account to a SQL Server Login. That solved the access violation error.
This is how you create a SQL Server Login from a Domain Account: