troubleshooting Question

Using table hints on SQL views

Avatar of navipartner
navipartner asked on
DatabasesMicrosoft SQL ServerSQL
5 Comments2 Solutions1875 ViewsLast Modified:
Hi,
I have made a view from one sql server (Win2003, SQL2000) to another (Win2003, SQL2005) using linked servers. I now try executing SELECT statements with table hints like
SELECT * FROM table_name WITH (FASTFIRSTROW)
which executes correctly but when I user an extra table hint like
SELECT * FROM table_name WITH (FASTFIRSTROW, UPDLOCK)
it fails with the error
Statement(s) could not be prepared
Incorrect syntax near 'FASTFIRSTROW'. If this is intended as a part of a table hint, a WITH keyword and parenthesis are now required. See SQL Server Books Online for proper syntax.

There's nothing wrong with the command as I can execute it on local tables on both source and target server. Is this just a problem with views? Can it be resolved?

Thanks in advance!
Best regards
ASKER CERTIFIED SOLUTION
lahousden

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 2 Answers and 5 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 2 Answers and 5 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros