'geography' Column Type throws an Error
jbattermann
Posts: 4
Good evening,
I am currently evaluating the SQL Data Generator (3) for one of my projects and I noticed for a table of mine it doesn't work.. well or I don't understand how to get it up and running.
There's one 'Location' column in the table of the 'geometry' type (it's a MS SQL 2012 R2 db) and the following error occurs:
The SQL generation script for that table looks like this:
.. and there's an Spatial index, too:
What exactly am I missing / doing wrong or what can I do to generate 'geography' data, too?
Thanks,
-Jörg
I am currently evaluating the SQL Data Generator (3) for one of my projects and I noticed for a table of mine it doesn't work.. well or I don't understand how to get it up and running.
There's one 'Location' column in the table of the 'geometry' type (it's a MS SQL 2012 R2 db) and the following error occurs:
The SQL generation script for that table looks like this:
CREATE TABLE [dbo].[MyTable]( [Id] [uniqueidentifier] NOT NULL, [CreatedAtUtc] [datetime2](7) NOT NULL, [UserId] [uniqueidentifier] NOT NULL, [Title] [nvarchar](100) NOT NULL, [Description] [nvarchar](1000) NULL, [Location] [geography] NOT NULL, [LocationName] [nvarchar](128) NULL, [CommentsCount] [int] NOT NULL, CONSTRAINT [PK_MyTable_Id] PRIMARY KEY CLUSTERED ( [Id] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] GO ALTER TABLE [dbo].[MyTable] ADD CONSTRAINT [DF_MyTable_Id] DEFAULT (newid()) FOR [Id] GO ALTER TABLE [dbo].[MyTable] ADD CONSTRAINT [DF_MyTable_CreatedAtUtc] DEFAULT (getutcdate()) FOR [CreatedAtUtc] GO ALTER TABLE [dbo].[MyTable] ADD CONSTRAINT [DF_MyTable_CommentsCount] DEFAULT ((0)) FOR [CommentsCount] GO
.. and there's an Spatial index, too:
CREATE SPATIAL INDEX [IX_MyTable_Location] ON [dbo].[MyTable] ( [Location] )USING GEOGRAPHY_AUTO_GRID WITH ( CELLS_PER_OBJECT = 20, PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] GO
What exactly am I missing / doing wrong or what can I do to generate 'geography' data, too?
Thanks,
-Jörg
Comments
What is the version of SQL Data Generator you have installed? Navigate to Help --> About SQL Data Generator in SQL Data Generator UI.
Product Support
Redgate Software Ltd.
E-mail: support@red-gate.com
Good evening,
unfortunately my trial has expired by now and I cannot navigate to the About dialog anymore, however e.g. the the 'RedGate.SQLDataGenerator.UI.exe' has a file version of 3.0.1.560.
Best regards,
-Jörg
Let me know if that code works.
Product Support
Redgate Software Ltd.
E-mail: support@red-gate.com
the trial extension worked & I've sent you further details via e-mail.
-J