Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2010-08-20
4
Medium Priority
?
476 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

So every once in a while at work I am asked to export data from one table and insert it into another on a different server.  I hate doing this.  There's so many different tables and data types.  Some column data needs quoted and some doesn't.  What …
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…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

705 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