Home > Archive > MS SQL Server > December 2005 > Wierd Error in CROSS APPLY









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Wierd Error in CROSS APPLY
Ganesh Muthuvelu

2005-12-28, 8:23 pm

When I run these statement below, it works.

select * from fn_getsubtree(1) AS ST
select * from Departments

However, when I run this statement below with CROSS APPLY, I get an error:
SELECT d.deptid
FROM Departments AS D
cross APPLY fn_getsubtree(D.deptmgrid) AS ST

The error message is:
Msg 102, Level 15, State 1, Line 3
Incorrect syntax near '.'.

What am I doing worng here?.

Thanks,
Ganesh
John Bell

2005-12-29, 7:23 am

Hi

This is effectively the same example as in SQL 2005 Books online, and it
works fine for me!!

Are you one the RTM version?

Do you have a case sensitive collation?

John
"Ganesh Muthuvelu" < GaneshMuthuvelu@disc
ussions.microsoft.com> wrote in
message news:B13248E1-CF2A-437E-9F88- 0AA3B55B08DB@microso
ft.com...
> When I run these statement below, it works.
>
> select * from fn_getsubtree(1) AS ST
> select * from Departments
>
> However, when I run this statement below with CROSS APPLY, I get an error:
> SELECT d.deptid
> FROM Departments AS D
> cross APPLY fn_getsubtree(D.deptmgrid) AS ST
>
> The error message is:
> Msg 102, Level 15, State 1, Line 3
> Incorrect syntax near '.'.
>
> What am I doing worng here?.
>
> Thanks,
> Ganesh



Tibor Karaszi

2005-12-29, 7:23 am

Most probably the database compatibility level is lower than 90. I tried the example in a new
database. It worked fine. I then lowered compatibility level to 80 and got the exact same error as
Ganesh posted.

--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www. solidqualitylearning
.com/

Blog: http:// solidqualitylearning
.com/blogs/tibor/



"John Bell" < jbellnewsposts@hotma
il.com> wrote in message
news:%23ndj%23MGDGHA
.2704@TK2MSFTNGP15.phx.gbl...
> Hi
>
> This is effectively the same example as in SQL 2005 Books online, and it works fine for me!!
>
> Are you one the RTM version?
>
> Do you have a case sensitive collation?
>
> John
> "Ganesh Muthuvelu" < GaneshMuthuvelu@disc
ussions.microsoft.com> wrote in message
> news:B13248E1-CF2A-437E-9F88- 0AA3B55B08DB@microso
ft.com...
>
>


Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com