I have a stored procedure function as well as table in the SQL Server enterprise 2014. I also have data in the table. Now I need same table and data in PostgreSql(pgAdmin4).
Can anyone suggest to me the idea to migrate data to POSTGRESQL or any idea on creating the SQL script so that I can use psql to run the script?
Advertisement
Answer
Depending on how much data you have, you could script out the table and data. Then you could tweak the script as needed for PostgreSQL:
- Right click on the SQL database > Tasks > Generate Scripts
- On the “Choose Objects” screen, select your specific table then select “Next>”
- On the “Set Scripting Options” screen, select “Advanced”
- Find the option called “Types of data to script”, then select “Schema and data” and select “OK”
- Set the filename and continue through the dialog until the file is generated
- Tweak the sql script for any specific PostgreSQL syntax
If there is a larger amount of data, you might look into some type of data transfer tool like SSIS.