Skip to content
Permalink
Browse files

[mssql] Fix test data creation script

  • Loading branch information
nyalldawson committed Oct 2, 2018
1 parent dce7b19 commit 72432246a18305cfa674826e2395bdc4433bd96b
Showing with 9 additions and 2 deletions.
  1. +9 −2 tests/testdata/provider/testdata_mssql.sql
@@ -1,4 +1,5 @@
CREATE SCHEMA qgis_test
CREATE SCHEMA qgis_test;
GO

CREATE TABLE qgis_test.[someData] (
pk integer PRIMARY KEY,
@@ -8,18 +9,21 @@ CREATE TABLE qgis_test.[someData] (
num_char nvarchar(max),
geom geometry
);
GO

CREATE TABLE qgis_test.[some_poly_data] (
pk integer PRIMARY KEY,
geom geometry
);
GO

CREATE TABLE qgis_test.[date_times] (
id integer PRIMARY KEY,
date_field date,
time_field time,
datetime_field datetime
);
GO

INSERT INTO qgis_test.[someData] (pk, cnt, name, name2, num_char, geom) VALUES
(5, -200, NULL, 'NuLl', '5', geometry::STGeomFromText( 'Point(-71.123 78.23)', 4326 )),
@@ -28,14 +32,17 @@ INSERT INTO qgis_test.[someData] (pk, cnt, name, name2, num_char, geom) VALUES
(2, 200, 'Apple', 'Apple', '2', geometry::STGeomFromText( 'Point(-68.2 70.8)', 4326 )),
(4, 400, 'Honey', 'Honey', '4', geometry::STGeomFromText( 'Point(-65.32 78.3)', 4326 ))
;
GO

INSERT INTO qgis_test.[some_poly_data] (pk, geom) VALUES
(1, geometry::STGeomFromText('Polygon ((-69.0 81.4, -69.0 80.2, -73.7 80.2, -73.7 76.3, -74.9 76.3, -74.9 81.4, -69.0 81.4))', 4326 )),
(2, geometry::STGeomFromText('Polygon ((-67.6 81.2, -66.3 81.2, -66.3 76.9, -67.6 76.9, -67.6 81.2))', 4326 )),
(3, geometry::STGeomFromText('Polygon ((-68.4 75.8, -67.5 72.6, -68.6 73.7, -70.2 72.9, -68.4 75.8))', 4326 )),
(4, NULL)
;

GO

INSERT INTO qgis_test.[date_times] (id, date_field, time_field, datetime_field ) VALUES
(1, '2004-03-04', '13:41:52', '2004-03-04 13:41:52' );
GO

0 comments on commit 7243224

Please sign in to comment.
You can’t perform that action at this time.