1

I'm trying to append certain rows from a table to another table. I used a SQL command to get the rows I wanted and Microsoft SQL Server Management Studio gave the output in the format of .RPT. So I want to append this RPT to my SQL table.

Is there a way to convert RPT to SQL so I can import it? If not, how do I download the database table from SQL on a Windows server, so I can put it on my Linux SQL server and manager it all with PHPMyAdmin there? I'm new to Windows hosting, and moving everything back to Linux.

User
  • 23,729
  • 38
  • 124
  • 207

3 Answers3

1

I was able to open the RPT file in Excel, manipulate it, then save as CSV to import into PHPMyAdmin.

User
  • 23,729
  • 38
  • 124
  • 207
1

Here are the steps to import the .rpt file to a SQL Server table. I will link to it instead of repeating it here. To summarize the steps, you can use the Import Export wizard and load it as a Ragged right file of format UTF-8.

GregGalloway
  • 11,355
  • 3
  • 16
  • 47
0

Why not write your select statement to generate the insert statements you need to run on your other database as follows

select "insert LinuxTableName(ColA,ColB) Values( " + ColA + "," + ColB + ") " from Table

Johnny Fitz
  • 532
  • 2
  • 8
  • 1
    Because they're on 2 different machines. – User Apr 29 '14 at 01:04
  • Ok, but the select statement I entered can be used to generate the scripts that you can then run on your Linux box. Alternatively you could export directly to csv file format from SSMS by doing the following: right-click Database, select Tasks ->Export Data. Sorry if I'm missing the point. – Johnny Fitz Apr 29 '14 at 07:29
  • 1
    Bit of a pain if those columns contain strings with special characters that need escaping (like quotation marks). – daiscog Mar 23 '16 at 11:53