Advertisement
MagnusArias

SBO | nPoint SQL

Jan 11th, 2020
323
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQL 0.73 KB | None | 0 0
  1. DROP TYPE N_Punkt
  2. GO
  3. DROP ASSEMBLY [N_Punkt_a]
  4. GO
  5. CREATE ASSEMBLY [N_Punkt_a]
  6. AUTHORIZATION [dbo]
  7. FROM 'C:\e740\repos\Funkcje\NPoint\NPoint\bin\Debug\NPoint.dll'
  8. WITH PERMISSION_SET = SAFE
  9. GO
  10. CREATE TYPE dbo.N_Punkt
  11. EXTERNAL NAME N_Punkt_a.nPoint;
  12.  
  13. DECLARE @a N_Punkt, @b N_Punkt;
  14. SET @a = CAST('1.2, 3, 7.8, 8' AS N_Punkt)
  15. SET @b = CONVERT(N_Punkt, '4, 7, 4, 6')
  16.  
  17. SELECT @a, @b,
  18. @a.ToString(),
  19. @a.SIZE,
  20. @a.Coordinates,
  21. @a.Coordinate(2),
  22. @a.Przesun('2, 4, 2, 5'),
  23. @a.PrzesunP(@b),
  24. @a.DistanceFromCoordinates('1, 2, 3, 4'),
  25. @a.DistanceFrom(@b),
  26. @a.DistanceFrom(@b.Przesun('2, 4, 2, 5'))
  27.  
  28. SELECT @a.ToSpatial()
  29. UNION ALL
  30. SELECT @b.ToSpatial()
  31.  
  32. SELECT @a.ToSpatialWithR(.1)
  33. UNION ALL
  34. SELECT @b.ToSpatialWithR(.1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement