I'm trying to create a buffer around a single point in a spatial entity and finding all the points from a different entity that fall within that buffer. I tried two approaches. The code below runs without error but returns no records, even though I know from looking at the data in ArcMap that there should records should come up (increasing the buffer to a huge number also didn't return any records). Removing the last line seems to create a buffer around every point in the incidents entity and finds every point in the hydrants entity. I want to figure out how to do this around just one point in the hydrants entity.
SELECT incidents.id_incident, hydrants.OBJECTID_1 FROM zelaya2.dbo.incidents, zelaya2.dbo.HYDRANTS WHERE Shape.STBuffer(1000).STIntersects(incidents.geog) = 1 AND hydrants.OBJECTID_1 = 177619;
Also tried setting a temporary variable as the buffer, but again got no records returns and no error message.
DECLARE @g geography; Set @g = (SELECT hydrants.Shape.STBuffer(1000) FROM zelaya2.dbo.hydrants WHERE OBJECTID_1 = 177619) SELECT * FROM zelaya2.dbo.incidents WHERE @g.STIntersects(incidents.geog) = 1
EDIT: I confirmed that both layers are SRID 4326