Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /****** Object: UserDefinedFunction [dbo].[fx_GetAirportsNearLatLong] Script Date: 10/30/2011 11:28:08 ******/
- IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[fx_GetAirportsNearLatLong]') AND type in (N'FN', N'IF', N'TF', N'FS', N'FT'))
- DROP FUNCTION [dbo].[fx_GetAirportsNearLatLong]
- GO
- USE [PSDB]
- GO
- /****** Object: UserDefinedFunction [dbo].[fx_GetAirportsNearLatLong] Script Date: 10/30/2011 11:28:08 ******/
- SET ANSI_NULLS ON
- GO
- SET QUOTED_IDENTIFIER ON
- GO
- CREATE FUNCTION [dbo].[fx_GetAirportsNearLatLong](@A float,@B float, @Distance int)
- RETURNS table AS
- RETURN
- (SELECT *
- FROM (SELECT ID,
- NAME,
- ICAO,
- dbo.Getlatlongdistance(@A, @B, WGS_DLAT, WGS_DLONG) AS
- Distance
- FROM dbo.Airport) AS x
- WHERE x.Distance < @Distance)
- GO
Advertisement
Add Comment
Please, Sign In to add comment