I have a table valued function that I'd like to add to my ssdt project.
create function dbo.fn_get_n_geos(@p0 nvarchar(max),@n bigint)
returns table
with schemabinding as
return
select top(@n) geo=geography::Point(latitude,longitude,4326)
,row=-1 + convert(int,row_number() over (order by (select 1)))
from openjson(@p0)
with (latitude float 'strict $[0]', longitude float 'strict $[1]');
When I add this function I get the following warnings::
SQL70561: Cannot schema bind function 'dbo.fn_get_n_geos' because name 'geography' is invalid for schema binding. Names must be in two-part format and an object cannot reference itself.
SQL70561: Cannot schema bind function 'dbo.fn_get_n_geos' because name 'float' is invalid for schema binding. Names must be in two-part format and an object cannot reference itself.
When I execute this function in SQL management studio everything works correctly. How do I get SSDT to play ball with these features?
My project is targeting SQL Server 2016.