STAsBinary (tipo di dati geography)

Si applica a:SQL Server database SQL di Azure Istanza gestita di SQL di Azure

Restituisce la rappresentazione WKB (Well-Known Binary) OGC (Open Geospatial Consortium) di un'istanza geography.

Questo metodo con tipo di dati geography supporta le istanze FullGlobe o le istanze spaziali con dimensioni maggiori di un emisfero.

Sintassi

  
.STAsBinary ( )  

Nota

Per visualizzare la sintassi Transact-SQL per SQL Server 2014 (12.x) e versioni precedenti, vedere la documentazione delle versioni precedenti.

Tipi restituiti

Tipo SQL Server restituito: varbinary(max)

Tipo CLR restituito: SqlBytes

Osservazioni:

Il tipo OGC di un'istanza geography può essere determinato richiamando STGeometryType().

Esempi

Nell'esempio seguente viene usato STAsBinary() per creare un'istanza LineString``geography da (-122.360, 47.656) a (-122.343, 47.656) dal testo. e viene restituito il risultato in formato WKB.

DECLARE @g geography;  
SET @g = geography::STGeomFromText('LINESTRING( -122.360 47.656, -122.343 47.656)', 4326);  
SELECT @g.STAsBinary();  

Vedi anche

Metodi OGC sulle istanze di geografia