Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2010-08-20
4
Medium Priority
?
486 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 29

Assisted Solution

by:sammySeltzer
sammySeltzer earned 1000 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 1000 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

Fill in the form and get your FREE NFR key NOW!

Veeam is happy to provide a FREE NFR server license to certified engineers, trainers, and bloggers.  It allows for the non‑production use of Veeam Agent for Microsoft Windows. This license is valid for five workstations and two servers.

Question has a verified solution.

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

If you having speed problem in loading SQL Server Management Studio, try to uncheck these options in your internet browser (IE -> Internet Options / Advanced / Security):    . Check for publisher's certificate revocation    . Check for server ce…
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Screencast - Getting to Know the Pipeline

972 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