Solved

How To Create A MSSQL Linked Server For Only One Database Or One Table?

Posted on 2010-08-20
4
439 Views
Last Modified: 2012-05-10
Greetings,

What is the syntax to create a linked server that will only allow a user to access one specific database or one particular table within a MSSQL user database?
0
Comment
Question by:Omega002
  • 2
4 Comments
 
LVL 28

Assisted Solution

by:sammySeltzer
sammySeltzer earned 250 total points
ID: 33487718
Hi,

Try this:
SELECT Count(*) FROM OPENQUERY('name of linked server', 'SELECT * FROM 'name of linked server'.'table or view name')[/

Let me know if you  have questions
0
 
LVL 2

Assisted Solution

by:bartjoosen
bartjoosen earned 250 total points
ID: 33487739
How about setup an ODBC connection for each user (user dsn instead of system dsn), and grant privileges for each user to the specific database, blocking public?

Bart
0
 

Assisted Solution

by:Omega002
Omega002 earned 0 total points
ID: 33487741
What is the syntax to create a linked server that will only give you access to one user database and what is the syntax to create a linked server that will only give you access to one table within a user database?
0
 

Accepted Solution

by:
Omega002 earned 0 total points
ID: 33487808
creating user DSN won't work if the user is connected to server A database emp2 and wants to query data on server B emp2 database while connected within emp2 on server A.
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I am showing a way to read/import the excel data in table using SQL server 2005... Suppose there is an Excel file "Book1" at location "C:\temp" with column "First Name" and "Last Name". Now to import this Excel data into the table, we will use…
In SQL Server, when rows are selected from a table, does it retrieve data in the order in which it is inserted?  Many believe this is the case. Let us try to examine for ourselves with an example. To get started, use the following script, wh…
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now