‎SSIS/SQL Server Agent execution issue‎ [closed] - sql-server

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

Related

Microsoft SQL Server auth_scheme do not show Kerberos [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 2 years ago.
Improve this question
I installed a small test environment in AWS to test Kerberos authentication using the SQL Server Cli found on GitHub. I followed some simple steps to get this set up.
Installed an Active Directory node with Windows Server 2019 Base.
Installed a second node with Windows Server 2012-R2 and SQL Server 2016 SP2 Enterprise.
I joined the SQL Server node to the AD and changed the auth part to use my AD.
I ran this query to test Kerberos
select auth_scheme from sys.dm_exec_connections where session_id=##spid
This query is only returning NTLM. Is there a way to fix this or did I miss something obvious in my setup?
EDIT: Added Raghavendra query to the question.
SQL\Administrator TSQL NTLM SQL Microsoft SQL Server Management Studio - Query
NT SERVICE\SQLSERVERAGENT TSQL NTLM SQL SQLAgent - Generic Refresher
NT SERVICE\SQLSERVERAGENT TSQL NTLM SQL SQLAgent - Email Logger
SQL\Administrator TSQL NTLM SQL Microsoft SQL Server Management Studio
NT SERVICE\SQLTELEMETRY TSQL NTLM SQL SQLServerCEIP
SQL\Administrator TSQL NTLM SQL Microsoft SQL Server Management Studio - Query
Output of setspn -L
PS C:\Users\Administrator> setspn -L sql
Registered ServicePrincipalNames for CN=SQL,CN=Computers,DC=mydomain,DC=com:
TERMSRV/SQL
TERMSRV/sql.mydomain.com
MSSQLSvc/sql.mydomain.com:1433
MSSQLSvc/sql.mydomain.com
WSMAN/sql
WSMAN/sql.mydomain.com
RestrictedKrbHost/SQL
HOST/SQL
RestrictedKrbHost/sql.mydomain.com
HOST/sql.mydomain.com
Can you try to use below query?
SELECT
a.session_id,
b.connect_time,
a.login_time,
a.login_name,
b.protocol_type,
b.auth_scheme,
a.HOST_NAME,
a.program_name
FROM sys.dm_exec_sessions a
JOIN sys.dm_exec_connections b
ON a.session_id = b.session_id
Refer this link for more info
In order to have "Kerberos" as auth_scheme, at the very least you need to log in as an AD user, not a local one. From what I see in your sys.dm_exec_sessions output, all connections are established under either NT Service, which is a local service account, or a local user ("local" meaning it is created on your SQL box, not in AD).
You need to create a domain user, say MyDomain\TestUser, and log onto your SQL box (or run your query tool, at least) using its credentials.
In case that's not enough, you should consult with this help article regarding additional configuration steps. In particular, check out the Kerberos Configuration Manager for SQL Server (its download link is available on the aforementioned page).
If my memory serves, apart from the SPN you need to set some flags for the SQL Server service account, but I can't recall their exact names - "Account is trusted for delegation", or something like that.

How to know I have SQL installed? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 3 years ago.
Improve this question
This is what I have if I search for SQL in my installed programs:
and if I try localhost then I get the connection error.
I CAN successfully connect to online database we have at work but for practicing I want to use my own local DB and I can't connect to it?
Check if you have an entry "Microsoft SQL Server xxxx" in your Start Menu > Programs. If so, you have some bits of SQL Server installed.
If you have this folder - try to find the "Configuration Tools > SQL Server xxxx Configuration Manager", and launch it.
If it open, it should show you a screen something like this:
In the "SQL Server Services" tab, find the entries labelled "SQL Server (xxxx)" - if you don't find any --> you do not have SQL Server installed.
If you find some - is their "State = running" ? If not - SQL Server is installed, but not running, so you cannot connect to it.
The value in brackets after "SQL Server" is the instance name - MSSQLSERVER stands for the default (unnamed) instance which you should be able to connect to using ., (local) (including the parenthesis!), or localhost.
If you see any other string, that's the instance name that needs to be used for connecting to it - in my case e.g. SQL2014, so I can connect to that instance using .\SQL2014, (local)\SQL2014, or localhost\SQL2014.

Cannot connect to remote SQL Server with SQL Server Management Studio with Visual Studio [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
I'm developing a small app on my own and I am trying to install a database on a local machine that I will be using for development.
So far I have done all of these things:
Install SQL Server Management Studio;
Created a server with name (fictious) is MYCPU/SQLEXPRESS
Created in it a database named MYPROJECT1and I have set the sizes as best as I could figure out
Added in security a login user named test / passwordfor connection tests;
SQL Server configuration manager tells me that the SQL Server service is running, the SQL Server agent is stopper and the SQL Server Browser is running;
Got the IP of my machine which will be (fictious) 254.254.254.123
In windows firewall, I have added an Inbound Rule named SQL Server Port 9999 (9999 being the proper port which is supposed to be listened by the Server);
I have a Linksys router and, on this router, in security tab, single port forwarding, I have a Remote Desktop connection with external / internal port routing to port 9999 with ip 254.254.254.123 and it is enabled;
I have authorized TCP/IP protocol on my server.
This resumes what I have done as best as I remember as I have tried many things. My objective is to connect to the MYPROJECT1 using a connection string in visual studio; however I do not know how to format this connection string, so I am using a modified connection string took from another project which connects on a remote database which works (but is not located at home):
<add name="MyDatabaseConnection"
connectionString="metadata=res://*/Models.Database.MYPROJECT1.csdl|res://*/Models.Database.MYPROJECT1.ssdl|res://*/Models.Database.MYPROJECT1.msl;provider=System.Data.SqlClient;provider connection string="data source=254.254.254.123;initial catalog=MYCPU/SQLEXPRESS\MYPROJECT1;user id=test;password=password;MultipleActiveResultSets=True;App=EntityFramework""
providerName="System.Data.EntityClient" />
However when I try to connect to this database, Visual Studio shows me the following error:
A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)
The system cannot find the file specified
I need help troubleshooting to find the exact cause of the problem and FINALLY connect to my database remotely, this would mean a lot to me. If you have any questions in the process or think that there is information missing, feel free to ask.
You incorrectly specified data source and initial catalog properties in connection string.
Instead of
data source=254.254.254.123;initial catalog=MYCPU/SQLEXPRESS\MYPROJECT1`
try to specify
data source=254.254.254.123\SQLEXPRESS;initial catalog=MYPROJECT1

MS SQL 2008 Job Fails [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 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.

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