Z (geometry Data Type)
The Z (elevation) value of the instance. The semantics of the elevation value are user-defined.
Applies to: SQL Server (SQL Server 2008 through current version), Azure SQL Database.
The following example creates a Point instance with Z (elevation) and M (measure) values and uses Z to fetch the Z value of the instance.
DECLARE @g geometry; SET @g = geometry::STGeomFromText('POINT(1 2 3 4)', 0); SELECT @g.Z;