I am creating spatial index on sqlserver table.
CREATE SPATIAL INDEX [SIndex_udt_cell_SP_GEOMETRY] ON [udt_cell] ( [SP_GEOMETRY] )USING GEOMETRY_GRID WITH ( BOUNDING_BOX =(80.0713, 26.389581, 88.169199, 29.974694), GRIDS =(LEVEL_1 = MEDIUM,LEVEL_2 = MEDIUM,LEVEL_3 = MEDIUM,LEVEL_4 = MEDIUM), CELLS_PER_OBJECT = 16, PAD_INDEX = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] GO
CREATE TABLE [udt_cell]( [ID_PK] varchar(9) not null, [PRINX] [int] NOT NULL, [STYLE] [varchar](254) NULL, [SP_GEOMETRY] [geometry] NULL, CONSTRAINT [PK_udt_cell] PRIMARY KEY CLUSTERED ( [ID_PK] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] )
I am getting error :
Implicit conversion from data type varchar to binary is not allowed. Use the CONVERT function to run this query.
Why am i getting this error although the column on which index is being created is geometry type? I have changed the primary key from varchar to int too.