Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Database & SysAdmin
  3. Database
  4. Convert scripts for Postgresql to SQL Server

Convert scripts for Postgresql to SQL Server

Scheduled Pinned Locked Moved Database
databasetoolspostgresqlsql-serversysadmin
6 Posts 3 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    Not Active
    wrote on last edited by
    #1

    I have a project to convert a database from Postgresql to SQL Server. I know of tools to convert the database from one to the other but all I have are scripts right now. Does anyone know of a utility that can take scripts created for Postgresql and create a SQL Server database from them?


    only two letters away from being an asset

    M T 2 Replies Last reply
    0
    • N Not Active

      I have a project to convert a database from Postgresql to SQL Server. I know of tools to convert the database from one to the other but all I have are scripts right now. Does anyone know of a utility that can take scripts created for Postgresql and create a SQL Server database from them?


      only two letters away from being an asset

      M Offline
      M Offline
      Mycroft Holmes
      wrote on last edited by
      #2

      Depending on the size of the database it would almost be worth installing postgre just to use the conversion tools. I'm assuming they have an express type product.

      Never underestimate the power of human stupidity RAH

      N 1 Reply Last reply
      0
      • M Mycroft Holmes

        Depending on the size of the database it would almost be worth installing postgre just to use the conversion tools. I'm assuming they have an express type product.

        Never underestimate the power of human stupidity RAH

        N Offline
        N Offline
        Not Active
        wrote on last edited by
        #3

        There is no express version but I already have Postgresql installed. The problem in the scripts I've been provided with won't run. I wanted to try converting them to TSQL and running them against SQL Server directly since the ultimate goal is to port it to SQL Server anyway.


        only two letters away from being an asset

        M 1 Reply Last reply
        0
        • N Not Active

          There is no express version but I already have Postgresql installed. The problem in the scripts I've been provided with won't run. I wanted to try converting them to TSQL and running them against SQL Server directly since the ultimate goal is to port it to SQL Server anyway.


          only two letters away from being an asset

          M Offline
          M Offline
          Mycroft Holmes
          wrote on last edited by
          #4

          Sounds like a hand job to me :laugh: That my double entendre for today.... I'd try splitting the scripts to types ie tables, procs and views, see if there are any standard conversions and try running them individually. Sounds like a LOT of work even if there are no constraints and key involved. I'd go back to the client and try and get a backup.

          Never underestimate the power of human stupidity RAH

          N 1 Reply Last reply
          0
          • M Mycroft Holmes

            Sounds like a hand job to me :laugh: That my double entendre for today.... I'd try splitting the scripts to types ie tables, procs and views, see if there are any standard conversions and try running them individually. Sounds like a LOT of work even if there are no constraints and key involved. I'd go back to the client and try and get a backup.

            Never underestimate the power of human stupidity RAH

            N Offline
            N Offline
            Not Active
            wrote on last edited by
            #5

            :laugh: :laugh: :laugh:

            Mycroft Holmes wrote:

            I'd go back to the client and try and get a backup.

            Trying. Unfortunately, I've taken over this project after the original team's failure. They are uncooperative to the point of potential legal actions by the client. I had the suspicion that it would a tedious manual process but had ask just in case.


            only two letters away from being an asset

            1 Reply Last reply
            0
            • N Not Active

              I have a project to convert a database from Postgresql to SQL Server. I know of tools to convert the database from one to the other but all I have are scripts right now. Does anyone know of a utility that can take scripts created for Postgresql and create a SQL Server database from them?


              only two letters away from being an asset

              T Offline
              T Offline
              Tim Carmichael
              wrote on last edited by
              #6

              As others have said, this is going to be a tedious manual process. I work with Ingres and SQLServer on almost a daily basis; Ingres isn't PostreSQL, but I'm assuming it isn't too far off either. If you have the scripts to create tables, etc, can you write a script to extract the table name, columns, datatypes and null settings? Having these, you should then be able to script the tables creation in SQLServer. I will help as I can. Tim

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups