MS SQL 2008 Job Fails [closed] - sql-server

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
I created an SSIS package to export a flat file based on a query using the Import/Export wizard. I used Windows Authentication for everything and have the flat file saved to a different server on the network. When I click Finish, it runs the query and the file is created, no problem.
Now, If I create a Job and schedule it to run at a specific time, it fails. It has something to do with the file path on the destination server. If I change it to the local C: drive on the database server, the job runs fine.
I noticed in the Job setup window, the only option to run the SSIS package is as "SQL Server Agent Service Account". I suppose this user does not have privileges to write to a network server? Like I said, the SSIS package runs fine - its when I try and run it as a scheduled job that it fails. The error message is that the destination file name is invalid.

I had this problem. You're right, it's a permissions issue despite the error message. When you run it manually, it's running under your account, but when the Job runs it, it's the account under which the SQL Agent Windows Service runs that's trying to write the file. So you need to make sure the SQL Agent account has access to the folder.
Just right click the folder, choose permissions and either give read/write access to "Everyone" or to be more safe give Read/Write permissions to the same account that the SQL Agent Windows Service runs under.

Related

‎SSIS/SQL Server Agent execution issue‎ [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
Here is a description of the issue and a couple of screen prints.
SSIS/SQL Server Agent execution issue
I have a package which executes without issue in SSIS Visual Studio debug mode, but when the package is deployed to the server and SQL Server Agent, the package fails with errors. I have searched online for answers and found a few but none have worked, including creating a proxy. The package contains 2 OLE connections to 2 different servers. If only 1 connection is used, it works without issue. If both are used, the job fails. I am attaching the screen print for a couple of the errors. This is all within Visual Studio 2019 and SQL Server 2016.
When the package runs from a SQL Agent job step it fails with:
Login failed for user 'REGISNET\RUW4-100$'
Login failed for user 'REGISNET\RUW4-100$'
Since SQL Agent is running with the default virtual account, any connections to other servers using Windows Auth will be made using the machine account.
You need to create a login on the target database for the machine account and grant it sufficient permissions for whatever the SSIS package is doing with that data source.
On the target database run
create login [REGISNET\RUW4-100$] from windows;
create user [REGISNET\RUW4-100$] for login [REGISNET\RUW4-100$];
create role etl_user;
alter role etl_user add member [REGISNET\RUW4-100$];
grant select to etl_user; --or whatever permissions are needed

SQL Jobs error for SSIS package of access data import

I am tearing my hair out with this particular issue, I have used SQL Agent Jobs for years and know there can be issues with permissions which I have always got around. But this issue I can't fathom. I am importing data from an Access Database to SQL Server via a SSIS package, I have had it successfully run via a SQL Job with no problem (using a proxy account). I need to change the login that runs the jobs, this has been set up with the same permissions and runs various jobs like running stored procedures. But when it tries to run the SSIS package it will not have it and I get a failed validation and returned error code 0xC020801C. It has exactly the same permissions, so why would it fail when I change the windows login account for the proxy? Any help would be hugely appreciative

Get database server backup from another server

I have two server. Server A is the application server, and server B is the database server. Normally I use SQL Management Studio in Server A to query. I intend to do a database backup (.bak), but whenever I do this through SQLMS, the file is created at server B. I dont have access to do a remote connection to server B.
How do I get the backup file?
You can specify a UNC path for the target of the backup. Keep in mind, however, that the account that the SQL Server service runs under will need network access to that path. This is one good reason why the SQL installer asks you which account to run the services under.
I ended up using generation script. But instead run all in a single script, I run 3 different script (create table, create stored procedure, and data) at a time. I do this because if I run in a single script, I ended up an error. By the way, the script can be compressed (zip) to give a smaller file size.

SQL Server Agent job not running package

I have an SSIS package that I have deployed to the file system. The owner for the package is my Windows Login. The reason for this is that it needs to write files to another server. If I make the owner NT SERVICE\SQLSERVERAGENT the error that I get is that the files on the remote server cannot be accessed.
The package itself runs under my account. The package normally takes about 5 minutes to run and works when run directly (double click, click Execute and enter decryption password). I can tell the package has run because it writes a number of logs to the file system.
I've set up a SQL Server job to run the package. The job says it's run successfully but there are no logs being written. I'm not sure where I've gone astray other than there's some account that I'm likely missing.
Has anyone else ever run into this?
The issue was that I needed to set up a proxy Account to run the SQL Server agent.

Connection to SQL Server 2008/2012 with dynamic ports [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
My problem is that I can't connect to any SQL Server instance installed on our server (it has both 2008 and 2012) using dynamic ports. Static ports works well. Also, if you mention dynamic port number in connection string, you can connect. But connection failed (regular error "Network or instance-specific...") with named instance without port number.
I found the solution - run sqlbrowser.exe -c on the server. After that everything works until server restarts. How to solve or diagnose it?
P.S. Firewall is OFF.
EDIT:
Also, when I'm closing this tool, it becomes inavaliable again. I'm not always connected to server with remote desktop. Now it works only when I connected and started this tool. Looks not OK for me.
If you want to connect to an instance without a port number, then the browser service must be running. The fix is simple. Set the browser service to start automatically in the services console or in SQL Server Configuration Manager.
With dynamic ports, the port number will change every time you restart the server.

Resources