FUNCTION  fGetNearestFrameidEq

Returns teh fieldid of the nearest frame to (@ra,@dec) at a given @zoom level.

ra, dec are in degrees. Zoom is a value in Frame.Zoom (0, 05, 10, 15, 20, 25, 30).

returns the fieldid of the nearest frame
Sample call to find frameid nearest to 185,0 and within one arcminute of it.

select *
from dbo.fGetNearestFrameidEq(185,0,10)

Input and output parameters