I am running the following code:
EXEC sp_linkedservers
Which returns:
However, I don't have any linked servers created on that instance.
So, how I get a true list of linked servers?
Thanks
Related
I have users with datareader permission on my sql, the problem is that i noticed that the users are doing "fishing" query a lot (they don't know what exactly should be querying to get what thy need).
This is a production SQL and we started to have deadlock because of those users.
Trying to don't break their process i applied "deny view definition to [user]" so they cannot see the list of tables, view, stored procedure, so no more "fishing"
This was a great solution, it works perfect if you connect directly to the SQL Server, you can run queries (select) but you cannot see the list of tables.
However many users are using those account to connect to our SQL using linked server, and when the run a query using the linked server they are getting error:
SELECT TOP 100 *
FROM [SERVERSQL].[DATABASE].dbo.[TABLE]
Msg 7314, Level 16, State 1, Line 1
The OLE DB provider "SQLNCLI11" for linked server "SERVERSQL" does not contain the table ""[DATABASE]"."dbo"."[TABLE]"". The table either does not exist or the current user does not have permissions on that table.
Using SQL Server version 2014 (v12.0.2000.8) and 2016 (v13.0.5492.2).
What is the correct way to hide tables, view, stored procedures, etc but allow select and make it work on linked server?
Thanks
Linked server from one SQL Server to Another:
Linked server name is: PLWNSAVSQL02D which is SQL Server
This sql to linked server works:
select count(*) from [PLWNSAVSQL02D].[SFI_WMS].dbo.[TCOMPANYPALLETMESSAGES];
I have one local database in SQL Server and one Oracle database as an linked server in SQL Server. I want to create a trigger on the linked server (Oracle database table) which will insert data into SQL Server table. This is what I have tried
CREATE TRIGGER TrgItemInsert
ON ORACLEDB..SYSTEM.ITEM
AFTER INSERT
AS
BEGIN
PRINT 'Something Happened to Table ITEM'
END
but I get the following error:
The object name 'ORACLEDB..SYSTEM.ITEM' contains more than the maximum number of prefixes. The maximum is 2.
Is this possible?
Is there any work around to achieve this task?
Connection to the linked server is working and I can query the data in the linked server using 'SELECT' statements.
Thanks in advance.
I'm trying to create a linked server in MSSQL to SharePoint in order to be able to write some storedprocs so that I can access them in Reporting Services.
I have created the link using the following...
EXEC master.dbo.sp_addlinkedserver #server = N'LINKTOSHAREPOINT', #srvproduct=N'ACE 12.0',
#provider=N'Microsoft.ACE.OLEDB.12.0', #datasrc=N'http://xxxx/CustomerService/Lists/',
#provstr=N'WSS;IMEX=1;RetrieveIds=Yes;LIST={3B85B1FA-C2C2-4D30-9DD4-0C42C6F85545}'
EXEC master.dbo.sp_addlinkedsrvlogin #rmtsrvname=N'LINKTOSHAREPOINT',#useself=N'True',#locallogin=N'sa',#rmtuser=NULL,#rmtpassword=NULL
I'm as confident as I can be that the List Guid and the server names are all correct. the Linked Server appears to connect but returns only "node" level info...
Catalogs --> Default --> Tables
But everything is empty.
I'm fairly sure it feels like a security issue, but I'm again confident that the windows login I use has access to most things.
Has anyone got any ideas or has even had this sort of thing working?
First, I know the syntax of calling a procedure on a linked server and I am familiar with the RPC and RPC Out server options at a basic level. What I am being told is that a procedure I created cannot be seen by navigating the tree of the linked server.
One caveat is I do not have access to the server where this person is working which is linked to the server on which I have the procedure - I hope that is clearly stated. At this time he is getting the "not configured for RPC" error on execution and I have told him to check the linked servers options. So ultimately, do the RPC linked server options control whether the procedure can be seen?
I've been told that other views can be seen. Also, I am confident it is not a permissions issue. The user involved has access to a role which has access to my procedure.
Thank you for your time.
In the Linked Server, Properties, Server Options there are two RPC settings.
Set them both to true.
What do you mean by do not have access?
You cannot Connect to that server?
That is how I tested this.
Connect to any server, create a Linked Server back to yours, and test.
This is true:
In the Linked Server, Properties, Server Options there are two RPC settings.
Set them both to true.
You also need to verify that the credentials used inside the linked server connection has rights on the linked server.
Grant connect, and access to the database that has the stored procedures that you need access too. You will then grant execute to the procedures you need to run.
If you have connection issues, open SSMS using the credentials you have used to create the linked server on the database server you are trying to link from and verify connectivity and database access. If you can see the objects your after, then the linkedserver connection is the problem. Try creating a new one and see if you have better luck that way.
I need to retrieve all the views provided by a linked server. Is there a query or another way to do this?
Try this:
SELECT * FROM [LINKED_SERVER].[DATABASE].sys.views
you can use this stored procecure:
exec sp_tables_ex 'Your linked server connection'
on the master db