How can we help you today? How can we help you today?

LayOut: Weirdness with CTEs

I entered the following into an SSMS window:
;with r as
(
	select
)

select *
from tbl
where

I selected only the "select * from tbl where" section, and clicked LayOut. As expected, it threw an error -- but the weird part is, it highlighted the end paren of the CTE, in addition to the end of the WHERE clause. I didn't have any of the CTE selected -- so I would expect that the product would not even consider the CTE in this case.

I assume this has something to do with CTEs, since if I try the same experiment with the following, only the selected code gets highlighted for errors:
select *
where r

select *
from tbl
where
amachanic
0

Comments

1 comment

  • Andras B
    amachanic wrote:
    ...
    I selected only the "select * from tbl where" section, and clicked LayOut. As expected, it threw an error -- but the weird part is, it highlighted the end paren of the CTE, in addition to the end of the WHERE clause. I didn't have any of the CTE selected -- so I would expect that the product would not even consider the CTE in this case.
    ...

    In the CTP we lay out the whole script, and do not consider selections. In the beta support for selections will be included.

    Regards,
    Andras
    Andras B
    0

Add comment

Please sign in to leave a comment.