0

I have SQL Server installed in Ubuntu 18.04 LTS but I am trying to generate a backup or script for a specific table data for example products table. I do not know how to generate a script or backup for product table because I have no GUI because it is a virtual machine server. This is how I access to server database:

enter image description here

I cannot find information in the internet how to generate a script for a specific table since most of the documentation shows how to generate a script using a GUI, but I am not. How do I solve this?

Dale K
  • 25,246
  • 15
  • 42
  • 71
EthernalHusky
  • 485
  • 7
  • 19

2 Answers2

0

You can use the bcp command to import/extract data from your db in a shell script. Ref: https://learn.microsoft.com/en-us/sql/linux/sql-server-linux-migrate-bcp?view=sql-server-ver15

tamizboule
  • 511
  • 4
  • 8
  • 19
  • Wow worked for me but... the data that I am exporting is very big and when I try to import to another database I get error, I do not know if there are special characters or the table has very big data. I have not marked this as solved because I have not done this yet, still trying. – EthernalHusky Jan 03 '21 at 05:41
  • how big is your dataset? what is the error message you're getting? – tamizboule Jan 04 '21 at 22:04
0

Below link talk about this solution and export data to csv file

Export table from database to csv file

Mahdi Rahimi
  • 564
  • 4
  • 22