Adinugraha
Adinugraha

Reputation: 3

Incorrect syntax near '.'. Sql Server 2008

I'm trying to do a SQL query Join with Function it gives me error this error:

SELECT * 
  FROM Tbl a
  CROSS APPLY V_TBL_STR(a.Number)

What can be the error? Thanks

Upvotes: 0

Views: 624

Answers (3)

Rajan
Rajan

Reputation: 303

Please try & let me know.

 SELECT * 
 FROM 
 Tbl AS a
 CROSS APPLY dbo.V_TBL_STR(a.Number) AS V


This is sample. I only have removed your function & put static value to check. It works for you then modify your sql or may be something problem with your sql

 SELECT *
 FROM Tbl
 CROSS APPLY (SELECT 'A' AS ABC UNION SELECT 'B' AS ABC) AS A

Upvotes: 1

Mansoor
Mansoor

Reputation: 4192

Use below query :

SELECT * FROM Tbl AS a
CROSS APPLY (SELECT [DBO].[V_TBL_STR](a.Number) [Number]) AS T 

Upvotes: 1

Charlesliam
Charlesliam

Reputation: 1313

Try this one

SELECT * 
  FROM Tbl a
  CROSS APPLY (SELECT V_TBL_STR(a.Number))

Upvotes: 1

Related Questions