INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Use Of REMOTE Hint

Use Of REMOTE Hint

(OP)
So I have a newer T-SQL developer in my company and I am code reviewing his first big set of work for me. The only real big thing I have found in his code is the constant use of the REMOTE hint when accessing linked servers. Sample queries provided below so you can see what I am referring to if you are unaware.

Well, to be prefectly honest, I had no idea what the REMOTE hint was and had to go look it up. I've been doing T-SQL coding for the better part of 15 years and never run into this hint before. I searched and found some decent articles on the hint. I also found a lot of references to it not being the optimization you might be expecting and how you should avoid it, or only consider it if your local table row count is much smaller than your remote table row count. This happens to be the case in his queries so it might be important.

I ran his queries, both with and without the hints, and can't see it providing any benefit to the overall cost. I reviewed our established company T-SQL standards (which I wrote most of and am responsible for maintaining as the senior T-SQL developer) and we have nothing in our document about this.

Before I go to him and ask him to remove the hints, I'd like to know if anyone has experience with the REMOTE table hint. If so, any knowledge you can share to me to understand this better. This is a good developer and I don't want to have a conversation with him about something I don't at least have a better understanding of. Thanks for helping me educate myself.

CODE

--Without REMOTE Hint
SELECT
	st.SyStudentId,
	st.FirstName,
	st.LastName
FROM LS_ODS.Students st
INNER JOIN OtherServer.CV_Prod.dbo.syStudent cst
	ON st.SyStudentId = cst.SyStudentId;

--With REMOTE Hint
SELECT
	st.SyStudentId,
	st.FirstName,
	st.LastName
FROM LS_ODS.Students st
INNER REMOTE JOIN OtherServer.CV_Prod.dbo.syStudent cst
	ON st.SyStudentId = cst.SyStudentId; 

Robert "Wizard" Johnson III
U.S. Military Vets MC
CSM, CSPO, MCPD, CCNA, CCDA, MCSA, CNA, Net+, A+, CHDP
Senior Database Developer

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close