December 01, 2020, 08:24:30 pm
News: GalahTech Community Based Technical Support!
Pages: [1]   Go Down
Author Topic: [RESOLVED] Restore MS SQL database without using .bak file  (Read 5439 times)
Slowhand
Supporters
*

Stars: +0/-0
Offline Offline

Gender: Male
Awards:
Topic Necromancer
Posts: 4668


I code C#!


WWW
« on: December 01, 2008, 10:18:25 am »

Hello people,

A customer of us has purchased hosting where we can install software for them.
What we didnt' know is, we don't have rights to restore .bak files.
The hosting provider does it once, after that we have to pay.

Since this is a product in development, it's possible we'll need to update the database a couple of times.

So I'm looking for a way to do this without restoring a new .bak file.
I wondered if there's a way to make a backup like MySQL does it, with a huge sql dump.
« Last Edit: December 02, 2008, 08:19:34 am by Slowhand » Logged


Jason Reed
Administrator
*

Stars: +4/-0
Offline Offline

Gender: Male
Posts: 4545

Pure Evil Administrator


WWW
« Reply #1 on: December 01, 2008, 12:57:25 pm »

Which version of SQL Server are you using?
Logged

-- signature --

Slowhand
Supporters
*

Stars: +0/-0
Offline Offline

Gender: Male
Awards:
Topic Necromancer
Posts: 4668


I code C#!


WWW
« Reply #2 on: December 01, 2008, 01:23:50 pm »

2005
Logged


Jason Reed
Administrator
*

Stars: +4/-0
Offline Offline

Gender: Male
Posts: 4545

Pure Evil Administrator


WWW
« Reply #3 on: December 01, 2008, 01:27:47 pm »

Ok I checked my "Express" version of it and I see no way to dump to SQL like MySQL. You can dump the structure to SQL but not the data inside which I figure is what you are wanting.

I'm guessing that to do this you would have to have an external app that reads the data from the database and creates an SQL script (with maybe a TRUNCATE call for each table). Then you could just run the standard SQL script without using a BAK file.

From what it looks to me is that MS thinks that the BAK file thing everyone would want to use and therefore doesn't provide any functionality to dump to SQL.
Logged

-- signature --

simmo
Administrator
*

Stars: +3/-0
Offline Offline

Gender: Male
Posts: 8560



« Reply #4 on: December 01, 2008, 07:25:52 pm »

are you restoring to a certain state? or needing as backups to prevent data corruption/loss?

If restoring to a state you can write the scripts, use the SQL to build the structure then have scripts to populate needed data. If using as a backup solution you could have scripts that pump records to another table and move them back as needed, but that might be fairly resource intensive.
Logged

                 ..... .....

Slowhand
Supporters
*

Stars: +0/-0
Offline Offline

Gender: Male
Awards:
Topic Necromancer
Posts: 4668


I code C#!


WWW
« Reply #5 on: December 02, 2008, 08:19:16 am »

I've found a Microsoft application, called Microsoft SQL Server Database Publishing Wizard, that can export both schema and data to an sql file, just like MySQL.
Logged


Pages: [1]   Go Up
Print
 
Jump to: