Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Is there a way?


Is there a way?

Author
Message
dwayne.hofstetter
dwayne.hofstetter
Forum Newbie
Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)

Group: General Forum Members
Points: 5 Visits: 12
If manually did a sql backup (example, right clicking on the database name, Tasks, Backup) is there any way to capture this so I can either create a sql script or have it capture it for me? I don't know how to look under the covers of the gui to see what this process is doing.... I just want to be able to replicate this exact process, but with a script that I can automate or run automatically.
Any suggestions for a newbie?

Thanks!
Sean Lange
Sean Lange
SSCoach
SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)

Group: General Forum Members
Points: 16550 Visits: 17004
dwayne.hofstetter (8/14/2013)
If manually did a sql backup (example, right clicking on the database name, Tasks, Backup) is there any way to capture this so I can either create a sql script or have it capture it for me? I don't know how to look under the covers of the gui to see what this process is doing.... I just want to be able to replicate this exact process, but with a script that I can automate or run automatically.
Any suggestions for a newbie?

Thanks!


You can always run profiler to track the sql statements that are being run. But in this case it is pretty straight forward because it is just a backup you want to execute.

http://technet.microsoft.com/en-us/library/ms186865.aspx

_______________________________________________________________

Need help? Help us help you.

Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.

Need to split a string? Try Jeff Moden's splitter.

Cross Tabs and Pivots, Part 1 – Converting Rows to Columns
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs
Understanding and Using APPLY (Part 1)
Understanding and Using APPLY (Part 2)
SQL Surfer '66
SQL Surfer '66
Say Hey Kid
Say Hey Kid (712 reputation)Say Hey Kid (712 reputation)Say Hey Kid (712 reputation)Say Hey Kid (712 reputation)Say Hey Kid (712 reputation)Say Hey Kid (712 reputation)Say Hey Kid (712 reputation)Say Hey Kid (712 reputation)

Group: General Forum Members
Points: 712 Visits: 328
In Management Studio:

Right click on the database -> Tasks -> Backup...

Make your choices in the Back Up Database dialog box

Instead of clicking OK to start the back up, click in the Script button on the top. This generates a script in a new query windows and the Back Up Database dialog box is still active.

If you click on the little triangle it gives you several choices to generate a script. The default action is: Script Action to New Query Window.
HanShi
HanShi
Hall of Fame
Hall of Fame (3K reputation)Hall of Fame (3K reputation)Hall of Fame (3K reputation)Hall of Fame (3K reputation)Hall of Fame (3K reputation)Hall of Fame (3K reputation)Hall of Fame (3K reputation)Hall of Fame (3K reputation)

Group: General Forum Members
Points: 3049 Visits: 3633
SQL Surfer '66 (8/15/2013)
Instead of clicking OK to start the back up, click in the Script button on the top. This generates a script in a new query windows ...


The option to script your actions is available on many places within SSMS. Many times it's also possible (for instance on a stored procedure) to right-click on an object and choose the "script as" option.
Great way to learn about T-SQL and see what the GUI is doing!

** Don't mistake the ‘stupidity of the crowd’ for the ‘wisdom of the group’! **
Grant Fritchey
Grant Fritchey
SSCoach
SSCoach (17K reputation)SSCoach (17K reputation)SSCoach (17K reputation)SSCoach (17K reputation)SSCoach (17K reputation)SSCoach (17K reputation)SSCoach (17K reputation)SSCoach (17K reputation)

Group: General Forum Members
Points: 17580 Visits: 32260
One of those instances where I wish we could vote on answers. SQL Surfer has nailed it. When you're creating that backup in the GUI, just generate the script.

----------------------------------------------------
The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood...
Theodore Roosevelt

The Scary DBA
Author of: SQL Server Query Performance Tuning and SQL Server Execution Plans
Product Evangelist for Red Gate Software
Ed Wagner
Ed Wagner
SSChampion
SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)

Group: General Forum Members
Points: 10240 Visits: 9560
This is a great way to learn what SQL the GUI is generating and firing, but consider taking it to the next step and checking out the commands on MSDN. That way you can not only learn the command, but a lot of the options available. This leads to a real understanding of the commands and you'll have it in your toolbox for later.


Tally Tables - Performance Personified
String Splitting with True Performance
Best practices on how to ask questions
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search