Linked Server is not working in Trigger - sql

I have a Linked Server that executes correctly in a Query, but when i tried to execute it inside a Trigger I was getting this:
Error Source: .Net SqlClient Data Provider
Error Message: The operation could not be performed because OLE DB provider "SQLNCLI" for linked server [LINKEDSERVER] was unable to begin a distributed transaction.
... Returned Message "The Transaction Manager has disabled its support for remote/network transactions"
Then I activated the DTC on both servers:
Here is how to configure MSDTC:
Go to Control Panel -> Administrative Tools
Open Component Services
Expand Component Services -> Computers -> My Computer -> Distributed Transaction Coordinator
Right click Local DTC
Click on Properties
Go to Security
And now I get this:
Error Source: .Net SqlClient Data Provider.
Error Message: Timeout Expired. The timeout period elapsed prior to completition of th eoperation or the server is not responding.

I have it working now, i just added a firewall rule at the remote server to MSDTC.EXE, inbound and outbound.
Thanks

Related

Processing SSAS Tabular model Fails Remote Server

I'm trying to create a SSAS Project and deploy to a remote server.
The Data Source is a Database in the same server, but the project must be made in my laptop.
The remote server is not in a domain environment, so to login in SSAS, I used runas /netonly mothod using Server's Administrator Account, which works fine to connect to SSAS Server through SSMS.
I created SSAS Project using Workspace Server and connection is successful.
I am also able to connect to same Server using SQL Server Database Data Source, using Impersonate Service Account, but after I select the tables I need, the processing fails and gives me this Error:
Failed to save modifications to the server. Error returned: 'OLE DB or ODBC error: [DataSource.Error] Microsoft SQL: 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: TCP Provider, error: 0 - The wait operation timed out.).
And as result I get all tables without data, just column names.
If I create a project using Integrated Workspace, I am able to get Data from Source, but the same Error occurs when I try to Deploy the Project. The metadata deploys successfully, but all processing fails with the same Error.
I tried to Increase Timeout, but the same thing happens even after waiting 30 minutes.
This process does not fail if I create and execute the project inside the Server.
Enable the TCP/IP in both Server NetWork and Client protocols;
Set TCP port:1433;
And then try it again.
Please reference this: troubleshoot-connecting-to-the-sql-server-database-engine

SSIS Error - The AcquireConnection method call to the connection manager failed with error code 0xC0202009

I have scoured high and low for a solution but nothing has helped. To be clear, I am not developing a SSIS package, I am simply trying to run one that has already proven to work. This issue is server specific.
We have an ETL Job that builds a repository from a production database for reporting purposes. I built a new VM server with bigger resources to ease the burden of this process on our larger databases.
Server is Windows Server 2012R2. Running SQL Server 2014 SP2 CU05 with integration services and really not much else. This job runs through the agent on 15 minute intervals. The first few times it runs, it does actually start building some of the data in the destination database, but this error persists with every new batch that is executed, whether manually or on schedule, and after a while it just stops moving data.
Here is the base error:
SSIS Error Code DTS_E_CANNOTACQVIRECONNECTIONFROMCONNECTIONMANAGER. The AcquireConnection method call to the connection manager "ETL_Framework" failed with error code 0xCO202009.
There may be error messages posted before this with more information on why the AcquireConnection method call failed.
Said error messages before the AcquireConnection call:
SSIS Error Code DTS_E OLEDBERROR. An OLE DB error has occurred. Error code: 0x80004005.
Source: "Microsoft SQL Server Native Client 11.0" Description: "Login timeout expired".
Source. "Microsoft SQL Server Native Client 11.0" Description: "A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online."
Source. "Microsoft SQL Server Native Client 11.0" Description: "Named Pipes Provider: Could not open a connection to SQL Server [2]. ".
One important thing to bear in mind is that both the source and destination databases are on this same server that the job is running from, meaning everything is localized and the domain service account is a local admin on the server and a sysadmin on SQL.
I have Named Pipes and TCP/IP protocols enabled on SQL. The service account running the job is a domain user that I have used hundreds of times on other servers setup for this same kind of work with never having a problem. I can connect via SSMS to this server from other VMs using the FQDN of the instance (i.e. SZDB.somewhere.com\SQL2014), and vice-versa.
So, open to suggestions here. There has to be something I am missing in the setup of my server.
We found that the solution in this case was to install a default instance of SQL Server. I previously only had a named instance running. As soon as I went through SQL setup and installed the default instance (i.e. MSSQLSERVER), the error on our ETL job went away and our data warehouse continued to build without any further issues. Proved to be the solution on two other servers as well that were exhibiting the same issue.

SQL Azure connectivity fails all of a sudden

I have a website hosted on GoDaddy server and many users access this website with their respective username and passwords. My database is in Azure. All of a sudden when the users of this website try to access the website with their username and password they fail to be identified as valid users though they are valid.
consequently when such a thing happens almost for more than 5 mins no user can login to the website. but i can very well connect to the database from my local server or through the azure portal.
the series of errors that gets logged into event viewer are as follows:
System.Data.SqlClient.SqlException: Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.
System.Data.SqlClient.SqlException: a transport-level error has occured when sending the request to the server.(provider:TCP provider,error:0 - An existing connection was forcibly closed by the remote host.)
System.Data.SqlClient.SqlException: 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: TCP Provider, error: 0 - A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.)
SourceEdge.BCL.BCLException: Unable to Execute ---> System.Data.SqlClient.SqlException: Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.
System.ArgumentNullException: Value cannot be null.
Parameter name: connection
after the error shown in 5 occurs all the subsequent logins will result in invalid user though the values are not null.
Can you tell me why this error happens all of a sudden. but it gets back to normal after a few minutes or even takes hours sometimes.
I'm not sure if you're aware of some pitfalls regarding connection handling to SQL Azure. The SQL Azure service might close connections at any time for some reasons. What you need is so called Transient condition handling. Not sure if this is the problem, but if you'are not aware of this, I'd suggest you read the following resources:
Microsoft Technet - Windows Azure SQL Database Connection Management
Microsoft Technet - Retry Logic for Transient Failures in Windows Azure SQL Database

SSIS OlEDB Connection manager Error

When am using sequence container to roll back my transactions in execute sql task i am getting the error
Connection manager Error: The SSIS Runtime has failed to enlist the OLE DB connection in a distributed transaction with error 0x8004D025 "The partner transaction manager has disabled its support for remote/network transactions.".
have set the transaction property to "Required" for Sequence container and inside all dataflow , execute sql tasks.
i am using two sql servers one is source other is target in the network. please help
You can find it by using the command dcomcnfg on the Run window. Next, Expand all nodes under Component Services, and then you will see Distributed Transaction Cordinator. After that, Right Click to open Properties window, then go to Security tab to enable Inbound/ Outbound messages.
You have to enable "Remote/Network Transactions" in the DTS Service located in the sql server server.
Administrative Tools. Component Services
Computers / MyComputer /
Properties / MSDTC /
Security Configuration /
Network DTC Access /
Allow Remote Clients -
Allow Inbound

Getting Login error in sql server 2008

I have SQL server 2008 and it was working fine ,but today while starting SQL server I am getting 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) (Microsoft SQL Server, Error: 2)"
In SQL Server Configuration Manager--> sql server services --> MS sql server and all other service status is showing as stopped(previously it was running). I have tried to make it start but the request failed..I have checked the event log ,its showing "The SQL Server (MSSQLSERVER) service failed to start due to the following error:
The service did not start due to a logon failure" ....My SQL server is taking windows authentication and few days back I have changed the PWD ..can it b the reason..pls help.
Note: Its not remote connection..the server is My system only..
Thanks Stuart for ur suggestions but the problem was a bit different.
I got the sloution from http://dotnet.org.za/thea/archive/2004/06/09/2069.aspx
Its working Now :-)
In server properties in security, check that server authentication is set to
SQL SErver and Windows Authentication mode.
EDIT: I had similar error after installation of service pack, the install switched the server authentication mode to windows only.
1.Management Studio
2.Object browser should be open in the left hand pane
3.Right click on the server instance name
4.Select properties from the menu choices
5.Server Properties dialog opens
6.Select security on the left hand menu items
7.On the right, there will be server authentication, select 'SQL Server and Windows Authentication Mode'
This should allow you to log in as sa, once running and you are in, make changes if required to Logins and Roles