类型几何不是定义的系统类型

时间:2016-01-27 14:51:16

标签: sql-server geometry

我只是运行此查询并在标题中获取错误

INSERT  [dbo].[PROPERTY] ([GPSId] ,[Energy],[corp_type],[irrigation],[variety],[trees],[utilizat],[number] ,[address],[water_hour],[owner_ID] ,[w_source],[w_inche],[Area] ,[Pool],[NoeMalekiat],[MotevasetBardasht]  ,[w_dore],[Shape],[idshahrestan],[idostan],[contex],[title])  VALUES ('WR-2627-4BS','هیچ کدام','درخت سیب','غرقابی','Null',0,'باغ','4','مهرگرد',90,1209504774,'چشمه',0,670.172195242369,1,'شش دانگ',0,0,Geometry::STGeomFromText('POLYGON ((550480.3407000020000000 3492052.1042000000000000, 550484.4087000050000000 3492054.7619999900000000, 550491.0337000000000000 3492050.1400000000000000, 550471.1482000160000000 3492031.7781000200000000, 550467.5869000140000000 3492032.8482000100000000, 550449.0791000050000000 3492051.8504000100000000, 550450.4848000070000000 3492058.8710999900000000, 550454.7364000020000000 3492064.5679000100000000, 550475.6995000040000000 3492052.7600000100000000, 550483.2033000110000000 3492053.9946000000000000, 550480.3407000020000000 3492052.1042000000000000))',32639).MakeValid(),13,14,2,6) 

这是我正在使用的sql server的版本

Microsoft SQL Server 2008 R2 (SP2) - 10.50.4042.0 (X64) 
Mar 26 2015 21:18:04 
Copyright (c) Microsoft Corporation
Express Edition (64-bit) on Windows NT 6.1 <X64> (Build 7601: Service Pack 1)

这是我的表创建sql

    USE [land_gis]
GO

/****** Object:  Table [dbo].[PROPERTY]    Script Date: 1/27/2016 6:21:31 PM ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE TABLE [dbo].[PROPERTY](
    [OBJECTID] [int] IDENTITY(1,1) NOT NULL,
    [GPSId] [nvarchar](50) NULL,
    [Energy] [nvarchar](50) NULL,
    [corp_type] [nvarchar](50) NULL,
    [Pool] [nvarchar](50) NULL,
    [irrigation] [nvarchar](50) NULL,
    [variety] [nvarchar](50) NULL,
    [trees] [int] NULL,
    [utilizat] [nvarchar](50) NULL,
    [number] [smallint] NULL,
    [address] [nvarchar](50) NULL,
    [water_hour] [numeric](38, 8) NULL,
    [owner_ID] [numeric](38, 8) NOT NULL,
    [w_source] [nvarchar](50) NULL,
    [w_inche] [numeric](38, 8) NULL,
    [Area] [numeric](38, 8) NULL,
    [pool_cap] [numeric](38, 8) NULL,
    [discript] [nvarchar](50) NULL,
    [Shape] [geometry] NULL,
    [w_dore] [numeric](38, 8) NULL,
    [idshahrestan] [numeric](38, 8) NULL,
    [idostan] [numeric](38, 8) NULL,
    [contex] [numeric](38, 8) NULL,
    [title] [numeric](38, 8) NULL,
    [NoeMalekiat] [nvarchar](50) NULL,
    [MotevasetBardasht] [nvarchar](50) NULL,
 CONSTRAINT [R14_pk] PRIMARY KEY CLUSTERED 
(
    [OBJECTID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 75) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]

GO

这是兼容级别

    USE [land_gis]
GO
SELECT compatibility_level
FROM sys.databases WHERE name = 'land_gis';
GO

结果是

100

我知道错误是因为sqlserver的版本,但据我所知,SQL Server 2008 R2支持几何类型。你能帮帮我吗?

非常感谢你

答案, 我应该将Geometry更改为geometry

0 个答案:

没有答案