sf1 is alias for function not table - the statement is: "... FROM ST.FilterQuery(''dbo.pokus'',''GEOM'', at P1 ) AS sf1 INNER JOIN dbo.pokus AS a1 ON sf1.id = a1.id". If it works on your system you have different version of MS SQL Spatial. We tried to change ST.FilterQuery function and then it works. Jan