Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Best Practice (Multiple Servers)

Author  Topic 

Vinnie881
Master Smack Fu Yak Hacker

1231 Posts

Posted - 2008-07-16 : 11:02:21
If I have two completely different instances and sql servers, but I need to query both in one procedure, Do I have any options besides creating a linked server if I want to join a table on it?

Also regarding security, what is the best practice (Just create a separate account on the remote server that only allows access to that one specific stored procedure I need? Or is it fairly safe to just use a existing user account on that linked server, even if they have execute permission on that entire remote database?)

Please let me know your thoughts.

Thanks

sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2008-07-16 : 11:17:40
your query performance will be really bad if you do this.
Go to Top of Page

Vinnie881
Master Smack Fu Yak Hacker

1231 Posts

Posted - 2008-07-16 : 11:30:05
Please clarify. What is your suggestion to do? I am open to a better practice.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-07-16 : 11:42:54
quote:
Originally posted by Vinnie881

If I have two completely different instances and sql servers, but I need to query both in one procedure, Do I have any options besides creating a linked server if I want to join a table on it?

Also regarding security, what is the best practice (Just create a separate account on the remote server that only allows access to that one specific stored procedure I need? Or is it fairly safe to just use a existing user account on that linked server, even if they have execute permission on that entire remote database?)

Please let me know your thoughts.

Thanks


you can either link them via linkedserver or use OPENDATASOURCE but as told earlier the performance will be poor. How frequently you need to join between two servers. is it for one time adhoc access? Can you please give some background info.
Go to Top of Page

Vinnie881
Master Smack Fu Yak Hacker

1231 Posts

Posted - 2008-07-16 : 11:47:56
It is for a adhoc Web application that will be used frequently. It's actually connecting our Website Primary DB that is in a internally ran DB to another Sql DB on our internal network. I would like this to be scalable, so what is your suggestion on getting the best performance w/o jeopardizing security?
Go to Top of Page

Vinnie881
Master Smack Fu Yak Hacker

1231 Posts

Posted - 2008-07-16 : 12:51:35
I guess the main question is, if I have two different servers that I need to use to query together, what option will give me the best overall performance?
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-07-16 : 13:05:35
None.

Can you replicate the data so that the data is now local instead of remote?

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

Vinnie881
Master Smack Fu Yak Hacker

1231 Posts

Posted - 2008-07-16 : 13:43:17
I guess I could, but this is my first time venturing into doing so. Do you have any articles that will point me in the right direction. Also can I set it up so the replication is instant (i.e. not daily, or something else)?

Thanks
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-07-16 : 13:46:09
quote:
Originally posted by Vinnie881

I guess I could, but this is my first time venturing into doing so. Do you have any articles that will point me in the right direction. Also can I set it up so the replication is instant (i.e. not daily, or something else)?

Thanks


Yup. you can have transactional replication

http://www.databasejournal.com/features/mssql/article.php/1438201
Go to Top of Page
   

- Advertisement -