Log in
::
Register
::
Not logged in
Home
Tags
Articles
Editorials
Stairways
Forums
Scripts
Videos
Blogs
QotD
Books
Ask SSC
SQL Jobs
Training
Authors
About us
Contact us
Newsletters
Write for us
Recent Posts
Recent Posts
Popular Topics
Popular Topics
Home
Search
Members
Calendar
Who's On
Home
»
SQL Server 7,2000
»
T-SQL
»
Creating an view with Option (Force order)
Creating an view with Option (Force order)
Rate Topic
Display Mode
Topic Options
Author
Message
jaybmehta
jaybmehta
Posted Wednesday, September 18, 2002 4:25 AM
Valued Member
Group: General Forum Members
Last Login: Thursday, August 18, 2005 11:40 AM
Points: 65,
Visits: 1
Hello Sir
I have a query which has an option(FORCE ORDER)
ie
select * from tab1 t1 inner join tab2 t2 on t1.c1 = t2.c1 inner join
tab3 t3 on t3.c1 = t2.c1
OPTION(FORCE ORDER)
When i am executing this query alone its working fine..
But when i try to make it as a view as this select statement then its giving a syntax error AS
"Incorrect syntax near keyword OPTION"
Can u have a view which has a select statement with OPTION FORCE ORDER, if please tell me the syntax for that
Thnks in Advance
Post #6868
Tao Klerks
Tao Klerks
Posted Thursday, October 25, 2012 11:37 AM
Ten Centuries
Group: General Forum Members
Last Login: Sunday, June 16, 2013 6:28 AM
Points: 1,383,
Visits: 1,214
I stumbled across this abandoned post today while attempting to address the same issue, and thought I'd update it with my conclusion: It's simply not possible to specify the "OPTION (FORCE ORDER)" hint in a view definition (or, so that matter, any SELECT statement options), because the option can only ever be specified once per statement/query - it belongs in the final statement that actually uses the view.
I would love to find an alternative, because guaranteeing that this hint is always specified on queries that use a particularly complex view can be onerous, or even unrealistic, but for now that seems to be the only option.
http://poorsql.com
for T-SQL formatting: free as in speech, free as in beer, free to run in SSMS or on your version control server - free however you want it.
Post #1377171
« Prev Topic
|
Next Topic »
Permissions
You
cannot
post new topics.
You
cannot
post topic replies.
You
cannot
post new polls.
You
cannot
post replies to polls.
You
cannot
edit your own topics.
You
cannot
delete your own topics.
You
cannot
edit other topics.
You
cannot
delete other topics.
You
cannot
edit your own posts.
You
cannot
edit other posts.
You
cannot
delete your own posts.
You
cannot
delete other posts.
You
cannot
post events.
You
cannot
edit your own events.
You
cannot
edit other events.
You
cannot
delete your own events.
You
cannot
delete other events.
You
cannot
send private messages.
You
cannot
send emails.
You
may
read topics.
You
cannot
rate topics.
You
cannot
vote within polls.
You
cannot
upload attachments.
You
may
download attachments.
You
cannot
post HTML code.
You
cannot
edit HTML code.
You
cannot
post IFCode.
You
cannot
post JavaScript.
You
cannot
post EmotIcons.
You
cannot
post or upload images.
Copyright © 2002-2013 Simple Talk Publishing. All Rights Reserved.
Privacy Policy.
Terms of Use.
Report Abuse.