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.
| Author |
Topic |
|
Tomco21
Starting Member
6 Posts |
Posted - 2007-05-22 : 10:45:02
|
Hi,I am trying to run the following...select PropertyID, a.*from Propertyinner join dbo.GetPropertyFacilities(Property.PropertyID)as a on 1=1where PropertyID = 16 The function GetPropertyFacilities basically takes the PropertyId and returns about 4 numbers which im trying to turn in to a list that looks like....16 5016 5216 4516 12The error I'm getting is...'Msg 4104, Level 16, State 1, Line 1The multi-part identifier "Property.PropertyID" could not be bound.'any help would be greatly appreciated.Thanks |
|
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
Posted - 2007-05-22 : 10:54:20
|
| This is not allowed in SQL 2000. If it is SQL 2005, you need to use APPLY operator instead.Harsh AthalyeIndia."The IMPOSSIBLE is often UNTRIED" |
 |
|
|
Tomco21
Starting Member
6 Posts |
Posted - 2007-05-22 : 11:13:47
|
Thats brilliant, thank you.For references it now works as...select PropertyID, a.* from Propertyouter apply dbo.GetPropertyFacilities(Property.PropertyID) a T |
 |
|
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
Posted - 2007-05-22 : 11:23:36
|
| Note that OUTER APPLY works similar to LEFT JOIN in the sense it will return rows from left side table even though function does not return any row. If what you really want is INNER JOIN, you may want to go for CROSS APPLY.Harsh AthalyeIndia."The IMPOSSIBLE is often UNTRIED" |
 |
|
|
|
|
|