Export files by SSIS to sharepoint (UNC) - Access is denied - sql-server

I am trying to export files by SSIS to sharepoint.
I have create package that is working on my computer. When I upload it on the SQL Server (SSIDB database) and try to run from SSISDB catalog I got error "Access is denied". I have log in to SQL Server by Windows Authentication and my username.
I have also log in to the database server (with my username) and try to create file in sharepoint directory and I have done that without an error. I can do that also by CMD script from server but when I try run this script in SSIS package deployed to SSMS I got an error "Access is denied".
My UNC directory looks like:
\sharepoint#SSL\DavWWWRoot\YYY
Regards
Piotr

Give the SQL Server Agent account (or whatever account you are running the job step as) the same permissions your account has in the sharepoint directory.

Related

SQL Server Management Studio access denied

I'm getting an error, says "Could not load the DLL xpstar.dll... Reason: 5(Access is denied)" right after logging into SQL Server Management Studio . Even though I can browse through the database schemas but I can't perform any action.
`My current configuration:
SQL Server Enterprise 2016
SQL Server 2016 Management Studio
Authentication mode: mixed mode`
SQL Server services
Binn folder permissions
What I've tried to figure out the cause:
Check Sql server services and they are all running.
Try connecting and performing some actions with SQLCMD (list tables, list db schemas...). It's all good.
Run SSMS as administrator.
Check permissions of BINN folder.
Disable Kaspersky Endpoint Security.
None of above steps can resolve the issue. So please kindly help me to fix it.
It turns out the folder ownership is the root cause. MSSQL and its subfolders were owned by SYSTEM. Even though Administrators group were assigned full control but They couldn't access to the folder. Probably, Kaspersky is involved. I'm not sure about that.
Solutions:
Change ownership of folder MSSQL (Drive:\Program Files\Microsoft SQL Server\MSSQLXX.MSSQLSERVER\MSSQL) from SYSTEM to Administrator.
Run SSMS as Administrator and problem is solved.

What are the minimum permissions to resolve the 'Unexpected termination' error when executing SSIS package via agent job (run as proxy/credential)?

My SSIS package creates folder on the D:, copies files from network path into this folder and creates new files into this folder. Package is deployed to the sql server ssis catalog.
To configure the package to run via sql agent job, I have connected to the SQL sever as sysadmin and:
Under security, configured a credential with username as domainname\user1 and the correct password.
Under SQL server agent\proxies I have then configured a proxy pointing to the credential, active to the following subsystem: SSIS Package.
Then I have created a Job with a step to run a SSIS package with RUN AS pointing to the above proxy.
When I right click on the job and hit start, the job fails with error. I see an 'Unexpected termination' error in the SSIS execution report. The execution report shows the error (on the task where it is trying to create Log provider file) as:
The SSIS logging provider has failed to open the log. Error code 0x80070003. The system cannot find the path specified.
Suppose I add the credential user (domainname\user1) to the computer's administrators group (in computer management) and then right click on job and hit start then it runs without any errors..
Then suppose I remove this user from the administrator group, and run the job, it again gives the same 'Unexpected termination' error but there is no error description.
I don't want to add this user to the computer's administrators group and I am not able to pin-point on what permission is needed for this account. What is the minimum permission required by the credential user for my scenario?
It is something to do with folder level permissions. The user not being able to create/access folders on the D drive. (Same issue if I try to use C:). I tried adding the user to the D drive security tab with Full Control. But the error persists.

Error authenticating proxy while running agent job

I am trying to schedule a SSIS2014 package via SQL Server Agent job. Both SSIS and SSMS are running on my local machine in the same domain. I am running SSMS with the same user Domain\Admin which is the creator of the SSIS package. SSMS 32-Bit and SSIS 32-Bit are running on Windows 7 64-Bit machine. I can run the package within SSIS without problems.
Using Microsofts KB article http://support.microsoft.com/kb/918760 and tutorial video http://technet.microsoft.com/en-us/library/dd440760%28v=sql.100%29.aspx I tried a couple of methods (proxy, configuration file, EncryptSensitiveWithPassword) but none of them worked for me.
When I use a proxy account to run the job step, the following message occurs:
Unable to start execution of step 1 (reason: Error authenticating proxy
`Domain\Admin`, system error: Logon failure: unknown user name or bad password.).
The step failed.
The proxy account uses the credentials identity Domain\Admin. Since the password fields for credential properties in SSMS cannot be left blank, I typed any password although my corresponding windows account has no password. So as mentioned above it's the same user account that created the SSIS package since Domain\Admin is stated in the CreatorName property of the SSIS package.
With this proxy, I tried to run SSIS jobs using the package ProtectionLevel's EncryptSensitiveWithUserKey and EncryptSensitiveWithPassword. Running the package manually within SSDT without problems, but from SSMS agent job the same error message appears. I tried the package sources "File System" and, after importing the package to MSDB, "SQL Server" and "SSIS Package Store". But exactly the same error message appears with each method.
Task manager shows that SSMS is running in administrator mode. Using Windows Component Services I added DCOM permissions for Domain\Admin to start and activate "Microsoft SQL Server Integration Services 12.0" from local. But the same error message appears. So in my opinion it's a problem with SSMS user account permissions (???) but unfortunately I don't know what exactly to do here. I tried the following:
In the system database MSDB (full path: Databases / System Databases / MSDB / Security / Logins) I assigned all available role memberships (Including db_ssisoperator, db_ssisltduser, db_ssisadmin) to Domain\Admin.
In server security (full path: Security / Logins) I assigned all available server roles. In the tab User Mapping, I assigned the MSDB database.
Still the same error message appears when I try to run the job. Does anybody have some ideas what I can try?

Elevated Rights Error when trying to deploy SSIS packages to a remote server

this is a new staging server with SQL 2008. I'm not famliary with SSIS that much so trying to deploy a couple packages. So I do the following in BIDS..which is probably typical:
Right-click my solution, go to properties, then go to the deployment utility tab
Change CreateDeploymentUtility to true
Go and find the .SSISDeploymentManifest file locally on my machine
Run it and try to perform a SQL Server deployment to the customer's remote server (we're running vpn to get to it)
I put in the fully qualified remote server's name, my windows auth or SQL account (I tried both ways)
Try to click now the Package Path and get this:
TITLE: Package Installation Wizard
An OLE DB error 0x80040E09 (The EXECUTE permission was denied on the object 'sp_ssis_listpackages', database 'msdb', schema 'dbo'.) occurred while enumerating packages. A SQL statement was issued and failed.
ADDITIONAL INFORMATION:
An OLE DB error 0x80040E09 (The EXECUTE permission was denied on the object 'sp_ssis_listpackages', database 'msdb', schema 'dbo'.) occurred while enumerating packages. A SQL statement was issued and failed.
BUTTONS:
OK
So what do I do? How do I essentially run this as an administrator to get past this stupid elevated rights security error?
You should add your windows / sql account to sysadmin role.
In SQL Server Management Studio, go to Security -> Server Roles and double click sysadmin. Add your login and it should work when you try again.

Restore Backup Access Denied

I'm trying to restore a backup from a .bak file to a local database server and keep getting the error message.
An exception occurred while executing a Transact-SQL statement or batch.(Microsoft.SqlServer.ConnectionInfo)
Cannot open backup device 'C:\Clients\SQLitis\jMKZ.bak'. Operating system error 5(Access is denied.).
RESTORE HEADERONLY is terminating abnormally. (Microsoft SQL Server, Error: 3201)
No idea where to even start troubleshooting this. I'm on an administrator account and have full privileges so there shouldn't be anything to deny me doing this but I'm still getting the error message.
Sounds like the service account that SQL Server runs under does not have permission to folder C:\Clients\SQLitis.
When SQL Server was installed, it hopefully was set up to use a domain user account (the "service account") that is NOT an administrator on the machine. As such, the SQL Server installer only grants permissions to the folders the SQL Server setup creates.
You need to give permission to that folder to the user account that SQL Server acts as. In my case it was NT Service\MSSQLSERVER
You can find/change the SQL Server user in SQL Server Configuration Manager. Here's a link that shows how:
http://www.bidn.com/blogs/ShawnHarrison/ssis/2134/access-denied-during-database-backup
Maybe a little hacky, but I solved the issue by copying the .bak file into the designated backup folder. That way I didn't have to change any permissions.

Resources