Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PostgreSQL database dump help. TIA.

Status
Not open for further replies.

ku97

Programmer
Jun 7, 2004
11
US
I have a PostgreSQL database dump file (.sql). It comes from an Oracle database. I am trying to import this file into MS SQL Server 2000. Can anyone help? I am not sure how to accomplish this and any help would be appreciated. Thanks.


David
 
Er... Postgres is one DBMS, Oracle another, SQL2k third.

This is probably ASCII dump file with DBMS-specific SQL statements containing data/structure?
 
Yes it is... here are the top few lines of code... I can post more if you think it would help...

--
-- PostgreSQL database dump
--

SET SESSION AUTHORIZATION 'postgres';

SET search_path = public, pg_catalog;

--
-- TOC entry 38 (OID 17388)
-- Name: plpgsql_call_handler(); Type: FUNC PROCEDURAL LANGUAGE; Schema: public; Owner: postgres
--

CREATE FUNCTION plpgsql_call_handler() RETURNS language_handler

 
Is there a way to import it into SQL Server?
 
Different DBMS = differences in SQL syntax = not an easy way to import (or better said, run in Query Analyzer).
 
Thank you for your help. Ok, if I use the table definitions in the file and recreate the table structure and then copy the text data of each database into a file (.cvs or something). Could I then import it? Do you have any ideas for me? Thanks again for all of your help.
 
Data is not a problem - dtswiz.exe, BULK INSERT statement and bcp utility are quite enough.

If you have database modeling tool capable of reverse engineering from SQL file, this may help a bit.
 
vongrunt, Thank you for your suggestions..
 
vongrunt:
how would you construct a BULK INSERT? Thanks. I never used it before.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top