Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Problem in CROSS APPLY

Author  Topic 

ganeshkumar08
Posting Yak Master

187 Posts

Posted - 2008-06-27 : 06:48:32
Hi,

My base table is TrendEvents
My Table valued UDF is fn_PassesAttemptedOwn_OR_OpponentHalf Which returns only one row,
based on the Base table's matchID,Player1ClubID,SegmentID,Time

My query is below..
Select TE.MatchID,TE.SegemntID,TE.Time,C.PasserID,C.ReceiverID
From TrendEvents TE
Cross Apply
dbo.fn_PassesAttemptedOwn_OR_OpponentHalf(TE.MatchID,TE.Player1ClubID,TE.SegmentID,TE.Time) As C

while executing the above query i am getting the below error message.

Msg 102, Level 15, State 1, Line 4
Incorrect syntax near '.'.

I tried in many ways like select * from dbo.n_PassesAttemptedOwn_OR_OpponentHalf()
and Select PasseriD,ReceiverID From dbo.n_PassesAttemptedOwn_OR_OpponentHalf()

I dont know what is actual error.

Thanks
Ganesh

Solutions are easy. Understanding the problem, now, that's the hard part

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-06-27 : 06:50:53
have you run the function seperately to see if it works fine?
Go to Top of Page

ganeshkumar08
Posting Yak Master

187 Posts

Posted - 2008-06-27 : 06:52:55
Yes visakh, it runs perfectly...
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-06-27 : 07:30:03
Are you sure this is code where this error happens. Cant spot anything obvious so thinking if it is from some other part of your full code which you didnt post.
Go to Top of Page

ganeshkumar08
Posting Yak Master

187 Posts

Posted - 2008-06-27 : 07:35:16
Only this code i am using no other code.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-06-27 : 07:37:39
i tried similar code and i'm not getting this error.
Go to Top of Page

ganeshkumar08
Posting Yak Master

187 Posts

Posted - 2008-06-27 : 07:42:34
can you send me the code.. And can i know how many rows and columns will return..
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-06-27 : 07:46:26
quote:
Originally posted by ganeshkumar08

can you send me the code.. And can i know how many rows and columns will return..


i just cahnged your tables and udf with one of my table and udf and it worked fine
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-06-27 : 07:48:22
Here's another example of similar code i posted here before

http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=104485
Go to Top of Page
   

- Advertisement -