This question already has answers here:
Closed 11 years ago.
Possible Duplicate:
How can I connect to an external database from a sql statement or a stored procedure?
I have a database server 'A'(SQL Server 2008) and database server 'B' (SQL Server 2005).
I need to pull some data from a database on server 'B' when I am on server 'A'.
I tried this query on Server 'A':
SELECT *
FROM [ServerName].[DataBaseName].[dbo].[TableName]
I am getting this error :
Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'
Is there some thing wrong with my query or do we need to change any setting on the server
so that I will be able to access the database.
You might still need to add a login for the linked server...
exec sp_addlinkedsrvlogin ‘LinkedServer’, 'true'
This will cause your 'A' server to try to impersonate your login on server B.
There's more detailed info / reference here: http://blogs.msdn.com/b/sql_protocols/archive/2006/08/10/694657.aspx
Related
I am using php laravel to connect to a sql server db, but there is an issue sql server db "closed php connection". When I check requests in Profiler Trace, I have 2 requests: first one is from php audit login, then audit logout. The query doesn't complete, and I don't know why.
1) This error I get it from laravel:
SQLSTATE[08S01]: [Microsoft][ODBC Driver 13 for SQL Server]TCP Provider: An existing connection was forcibly closed by the remote host.
(SQL: select * from contact)
2) Image from SQL SERVER Profiler Trace
I have a SQL statement that merges 2 databases together, from 2 different servers (SQL Server 2012 for both).
The two servers are linked, so when executing the statement in a query window from Management Studio with the SA account it works perfectly.
However, I need to automatize this. I created a Job in the SQL Server Agent, and I keep getting an authentication error. This is because the user that is executing the SQL Server Agent service doesn't have the SA rights on both servers.
This is the error:
The OLE DB provider 'providerName' for the connection server
'serverName' reported an error. Authentication failed.
I tried setting a superadmin user from the Active Directory with all rights on both servers to execute the SQL Server Agent, but I still get the error.
Is there any way to fix this?
Thanks
You can store your linked server credentials with your linked server definition (forbid my picture editing skills ;-)):
Alternatively - and much more preferabele from security point of view - setup same account on both servers (you can then limit the account privileges as you need) and use the third option ('Be made using the login's current security context')
This question already has an answer here:
ColdFusion 10/Windowns 7 Pro 64bit Connection verification failed for data source
(1 answer)
Closed 6 years ago.
I am trying to connect datasource in coldfusion admin with my local sql server 2014 but it is not connecting . I have tried every method to do this but no success.
I have also created new user but it is also not working.
I am getting this error
Connection verification failed for data source: mlc_new
java.sql.SQLInvalidAuthorizationSpecException: [Macromedia][SQLServer
JDBC Driver][SQLServer]Login failed for user 'tester'. The root cause
was that: java.sql.SQLInvalidAuthorizationSpecException:
[Macromedia][SQLServer JDBC Driver][SQLServer]Login failed for user
'tester'.
the datasource details are
datasource name: mlc_new db name: mlc_new sever: DEV-PC\SQLEXPRESS
username: tester password : somestring
Some details on SQL Server mixed authentication. To enable do, the following:
Connect to DB server (presumably via Windows Authentication
Right click for properties on the server icon
On the properties dialog go to Security
Select "SQL Server and Windows Authentication mode". Save.
I have an existing instance of ColdFusion 11 server and SQL Server 2012 on a Windows 7 Ultimate platform.
I have several SQL Server datasources already connected successfully connected using: localhost\SQLEXPRESS, username "sa" and my password. When I try to add a new database in the CF Administrator I get this error:
Connection verification failed for data source: ocm5
java.sql.SQLInvalidAuthorizationSpecException: [Macromedia][SQLServer
JDBC Driver][SQLServer]Login failed for user 'sa'. The root cause
was that: java.sql.SQLInvalidAuthorizationSpecException:
[Macromedia][SQLServer JDBC Driver][SQLServer]Login failed for user
'sa'.
It appears to be a login issue, not a connection issue so I don't think it has to do with source limits on Developer platforms.
In 2012 or beyond you will not be able to us "sa" - and you should never use it anyway to set up a datasource. Doing so opens up a huge attack vector directly to your data and your server itself.
You will need to set up a separate username and password and give it DBO permissions to your DB. This will expose only your specific database to your CF connection. If you can you should narrow permissions further - do you really need "create" permissions for example?
We have an Excel file from which it retrieves information from a SQL Server DB.
Here is a snippet of the code:
Provider=SQLOLEDB.1;Persist Security Info=True;User ID=mjone;Initial Catalog=pff_db;Data Source=....
My question is that for mjone, how is he able to get connected to the SQL Server DB? I am looking at the SQL Server Management Studio and do not see any mjone used.
Check these:
Check the users under `pff_db`
Check global SQL Server Users
Check if that user exists in the server (Windows)