Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

create backup with sql commands

Status
Not open for further replies.

michelleqw

Programmer
Jan 4, 2004
120
DE
Dear MSserver users,

Is there any posibility to generate a .sql file as backup voor a database. We are using SQLserver 2000.

With the help of "generate SQL script" we can only create a header (fields) of the database.

After create database and tables we want to see also the information what will be inserted.

Nice regards,

Michelle.
 
Is it necessary to script the data as INSERT statements or do you just want to see the data that will be imported?

You could use BCP to output the data to a text file that you could read with any text editor, and use BCP to import the data back into the target database. Check out bcp utility, overview in Books Online. Would that do the trick? Good luck!

--John [rainbow]
-----------------------------------
Behold! As a wild ass in the desert
go forth I to do my work.
--Gurnie Hallock (Dune)
 
It would be muc easier to just to backups of the database to disk or tape. It would also take up much less room than creating a script of the entire database.

You would have to develope the scripts by hand for each table to do this. Using some nested cursors and the INFORMATION_SCHEMA tables you could probably automate this.

Denny
MCSA (2003) / MCDBA (SQL 2000)

--Anything is possible. All it takes is a little research. (Me)

[noevil]
(My very old site)
 
No. I really don't believe it's possible. Why would you want to do that anyways?

Just do a full backup of the database and restore it. That would be MUCH quicker than having a script that inserts each row of data.

Again, what are you really trying to do?

-SQLBill

Posting advice: FAQ481-4875
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top