SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
Space before table hint

 
Reply to topic    SoftTree Technologies Forum Index » SQL Assistant View previous topic
View next topic
Space before table hint
Author Message
Olegon



Joined: 07 Sep 2009
Posts: 39
Country: Kazakhstan

Post Space before table hint Reply with quote
SQL Assistant 4.7.11
MS SQL 2005, MS SQL Server Managment Studio

There is the code:

Code:
select * from dbo.Accounts a (nolock)


When I select the code and do the formatting, I get the following

Code:
select
  *
from
  dbo.Accounts a(nolock)


This is that I need, but where the space between table alias "a" and table hint "(nolock)"? Why he is deleted?

My rule for "select":
Code:
select
  ... as ...,
  ... = ...
from
  ... as ...,
  ...
  join ...
    on
      ... = ... and
      ...
where
  ... = ... and
  ... or
  ...
group by
  ...,
  ...
having
  ...,
  ...
order by
  ...,
  ...

Tue Sep 08, 2009 3:37 am View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7849

Post Reply with quote
This is because the syntax is incorrect. You are missing WITH keyword before the hint. Note that using hints without WITH keyword is ok in SQL 2000, partially supported in 2005 and discontinued in 2008

Now, if you want to apply special formatting to a text like WITH (hint here) , you can add your own formatting rule.
Code:
WITH (...)

or something similar
Tue Sep 08, 2009 8:17 am View user's profile Send private message
Display posts from previous:    
Reply to topic    SoftTree Technologies Forum Index » SQL Assistant All times are GMT - 4 Hours
Page 1 of 1

 
Jump to: 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


 

 

Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Flowers Online.