'geography' Column Type throws an Error

jbattermannjbattermann Posts: 4
edited January 20, 2015 3:10PM in SQL Data Generator
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:

SQL_Data_Generator_Geography_Error.png

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

  • Anu DAnu D Posts: 876 Silver 3
    Thanks for your post and apologies for the delay in getting back to you.

    What is the version of SQL Data Generator you have installed? Navigate to Help --> About SQL Data Generator in SQL Data Generator UI.
    Anuradha Deshpande
    Product Support
    Redgate Software Ltd.
    E-mail: support@red-gate.com
  • Thanks for your post and apologies for the delay in getting back to you.

    What is the version of SQL Data Generator you have installed? Navigate to Help --> About SQL Data Generator in SQL Data Generator UI.

    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
  • Anu DAnu D Posts: 876 Silver 3
    I have emailed you the trial extension so you can use it for another 14 days and we can look into this issue?

    Let me know if that code works.
    Anuradha Deshpande
    Product Support
    Redgate Software Ltd.
    E-mail: support@red-gate.com
  • Anu,

    the trial extension worked & I've sent you further details via e-mail.

    -J
Sign In or Register to comment.