Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 SQL Server Administration (2005)
 Generate Script while backin up

Author  Topic 

Peace2007
Posting Yak Master

239 Posts

Posted - 2008-07-09 : 00:37:51
Hi

I'd like to know if there's a way to generate backup script while taking a backup from database. the same functionality we have in mySQL.

Thanks

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2008-07-09 : 01:33:36
yes. Right click on the database - tasks - back up, in the "Backup Database" dialog box click on the Script button


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

Peace2007
Posting Yak Master

239 Posts

Posted - 2008-07-09 : 01:44:54
Thannnnnk you :)
But doesn't it have any option to generate script as creating DB schema and inserting data to it?
Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2008-07-09 : 01:47:54
just right click on the database and see the scripting database option there.

No, it does not generate script for inserting data


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2008-07-09 : 08:21:48
quote:
Originally posted by Peace2007

Hi

I'd like to know if there's a way to generate backup script while taking a backup from database. the same functionality we have in mySQL.

Thanks



you mean T-Sql Script. Yes while doing backup from Gui, you will see in top as script.
Go to Top of Page

Peace2007
Posting Yak Master

239 Posts

Posted - 2008-07-12 : 03:28:57
quote:
Originally posted by sodeep


you mean T-Sql Script. Yes while doing backup from Gui, you will see in top as script.



I've tried that but it doesn't generate any TSQL for inserting data am I right?!
The script I saw was something like this:
BACKUP DATABASE [...] TO  DISK = N'C:\d.bak' WITH NOFORMAT, NOINIT,  NAME = N'...-Full Database Backup', SKIP, NOREWIND, NOUNLOAD,  STATS = 10
GO
Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2008-07-12 : 03:45:26
Correct. It does not do that.

See http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=73608 for scripting data


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

Peace2007
Posting Yak Master

239 Posts

Posted - 2008-07-12 : 08:04:03
Thanks :) Just wanted to be sure of that
Go to Top of Page

sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2008-07-12 : 11:00:14
quote:
Originally posted by Peace2007

quote:
Originally posted by sodeep


you mean T-Sql Script. Yes while doing backup from Gui, you will see in top as script.



I've tried that but it doesn't generate any TSQL for inserting data am I right?!The script I saw was something like this:
BACKUP DATABASE [...] TO  DISK = N'C:\d.bak' WITH NOFORMAT, NOINIT,  NAME = N'...-Full Database Backup', SKIP, NOREWIND, NOUNLOAD,  STATS = 10

What do you mean Inserting data here? I don't think MySQL does that too



Go to Top of Page

Peace2007
Posting Yak Master

239 Posts

Posted - 2008-07-12 : 23:44:12
yes in mySQL and oracle you can generate a script, which creates the database and inserts data
Go to Top of Page
   

- Advertisement -