Drop Table
Support Forum for database administrators and web based access to important newsgroups related to databasesWhen 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
Post Follow-up to this messageHi 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
Post Follow-up to this messageMost 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 t he 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 w orks 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 me ssage > news:B13248E1-CF2A-437E-9F88- 0AA3B55B08DB@microso ft.com... > >
Post Follow-up to this message
Show a Printable Version
Email This Page to Someone!
Receive updates to this thread