Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is easiest way to transfer tables between MSSQL databases without a network connection?

I have a small app/site on a dev server with a data table in SQL Server [varchar(40),varchar(40),varchar(MAX)]. I want to take the data table and push it to the live server. I have tried exporting in txt, Excel and Access but every time there is an error on import related to not being able to parse due to the data in the varchar(MAX) field or unicode to non-unicode conversion from Access.

I feel like I'm overlooking a good solution here. This doesn't need to be automated at the moment. I believe there are ways to transfer tables between databases connected through a network/internet connection but our live database is not accessible from our office. I've used a data export in MySQL before that creates a script to run on another database to insert all data records, but I don't believe that is available in MSSQL.

Any suggestions?

like image 545
Dan Roberts Avatar asked Dec 22 '22 13:12

Dan Roberts


2 Answers

I've used a data export in MySQL before that creates a script to run on another database to insert all data records, but I don't believe that is available in MSSQL.

Aha! You can do this in Microsoft SQL, basically. A little-known Microsoft utility, the "SQL Server Database Publishing Wizard," exists and does what you're talking about.

http://www.microsoft.com/downloads/details.aspx?familyid=56E5B1C5-BF17-42E0-A410-371A838E570A&displaylang=en

Why this isn't a standard part of SQL Server, I have no idea.

like image 100
John Rose Avatar answered May 10 '23 06:05

John Rose


You could use sql server backup and restore features (details here)

If you want to limit the backup to a single table (because the database is too big for example), You can put your table in its own file group and use the backup feature of sql server on that file group.

If you don't know what a filegroup is, you will find some information here

like image 32
Brann Avatar answered May 10 '23 06:05

Brann