converting microsoft sql server 2000 sql-code for postgresql 7.2.1

From: "william windels" <william(dot)windels(at)pandora(dot)be>
To: <pgsql-sql(at)postgresql(dot)org>
Subject: converting microsoft sql server 2000 sql-code for postgresql 7.2.1
Date: 2003-01-28 10:08:16
Message-ID: 000901c2c6b5$2deef350$240aa8c0@L1PC01
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hello all,

I a m a new member of the list and at the moment , I am studiing
informatica: sql.

At the workplace, we use microsoft sql server 2000.
At home, I use postgresql 7.2.1 and now I would import the data of the
database at the workplace into the postgresql environment at home.

I have paste a little part of the sql-code to create a table in a database
called "tennisclub".

To execute the code bellow with pgsql, I do the following steps:

pgsql tennisclub
\e file_with_sql_code.sql

The contens of the file file_with_sql_code.sql is as follows:

CREATE TABLE SPELERS

(SPELERSNR SMALLINT NOT NULL,

NAAM CHAR(15) NOT NULL,

VOORLETTERS CHAR(3) NOT NULL,

VOORVOEGSELS CHAR(7) ,

GEB_DATUM datetime ,

GESLACHT CHAR(1) NOT NULL,

JAARTOE SMALLINT NOT NULL,

STRAAT CHAR(15) NOT NULL,

HUISNR CHAR(4) ,

POSTCODE CHAR(6) ,

PLAATS CHAR(10) NOT NULL,

TELEFOON CHAR(10) ,

BONDSNR CHAR(4) ,

PRIMARY KEY (SPELERSNR) );

INSERT INTO SPELERS VALUES (

6, 'Permentier', 'R', NULL, '1964-06-25', 'M', 1977, 'Hazensteinln',

'80', '1234KK', 'Den Haag', '070-476537', '8467'

);

INSERT INTO SPELERS VALUES (

44, 'Bakker', 'E', 'de', '1963-01-09', 'M', 1980, 'Lawaaistraat',

'23', '4444LJ', 'Rijswijk', '070-368753', '1124'

);

INSERT INTO SPELERS VALUES (

83, 'Hofland', 'PK', NULL, '1956-11-11', 'M', 1982, 'Mariakade',

'16a', '1812UP', 'Den Haag', '070-353548', '1608'

);

INSERT INTO SPELERS VALUES (

2, 'Elfring', 'R', NULL, '1948-09-01', 'M', 1975, 'Steden',

'43', '3575NH', 'Den Haag', '070-237893', '2411'

);

INSERT INTO SPELERS VALUES (

27, 'Cools', 'DD', NULL, '1964-12-28', 'V', 1983, 'Liespad',

'804', '8457DK', 'Zoetermeer', '079-234857', '2513'

);

INSERT INTO SPELERS VALUES (

104, 'Moerman', 'D', NULL, '1970-05-10', 'V', 1984, 'Stoutlaan',

'65', '9437AO', 'Zoetermeer', '079-987571', '7060'

);

INSERT INTO SPELERS VALUES (

7, 'Wijers', 'GWS', NULL, '1963-05-11', 'M', 1981, 'Erasmusweg',

'39', '9758VB', 'Den Haag', '070-347689', NULL

);

INSERT INTO SPELERS VALUES (

57, 'Bohemen', 'M', 'van', '1971-08-17', 'M', 1985, 'Erasmusweg',

'16', '4377CB', 'Den Haag', '070-473458', '6409'

);

INSERT INTO SPELERS VALUES (

39, 'Bischoff', 'D', NULL, '1956-10-29', 'M', 1980, 'Ericaplein',

'78', '9629CD', 'Den Haag', '070-393435', NULL

);

INSERT INTO SPELERS VALUES (

112, 'Baalen', 'IP', 'van', '1963-10-01', 'V', 1984, 'Vosseweg',

'8', '6392LK', 'Rotterdam', '010-548745', '1319'

);

INSERT INTO SPELERS VALUES (

8, 'Niewenburg', 'B', NULL, '1962-07-08', 'V', 1980, 'Spoorlaan',

'4', '6584WO', 'Rijswijk', '070-458458', '2983'

);

INSERT INTO SPELERS VALUES (

100, 'Permentier', 'P', NULL, '1963-02-28', 'M', 1979, 'Hazensteinln',

'80', '6494SG', 'Den Haag', '070-494593', '6524'

);

INSERT INTO SPELERS VALUES (

28, 'Cools', 'C', NULL, '1963-06-22', 'V', 1983, 'Oudegracht',

'10', '1294QK', 'Leiden', '010-659599', NULL

);

INSERT INTO SPELERS VALUES (

95, 'Meuleman', 'P', NULL , '1963-05-14', 'M', 1972, 'Hoofdweg',

'33a', '5746OP', 'Voorburg', '070-867564', NULL

);

This code doesn't work.

Can someone tell me how I can adjust the syntax of the code and in global:
how can I convert sql-code , for microsoft sql server 2000, to sql-code for
postgresql?

Thanks in advance

best regards

William Windels

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Geraint Jones 2003-01-28 10:27:39 Re: converting microsoft sql server 2000 sql-code for postgresql 7.2.1
Previous Message Rodger Donaldson 2003-01-28 07:05:15 Cross-table constraints