Tech Support Websites

  • Subscribe to our RSS feed.
  • Twitter
  • StumbleUpon
  • Reddit
  • Facebook
  • Digg

Monday, 26 December 2011

HOW TO back up a database (schema and data) as a SQL Server script

Posted on 06:48 by Unknown
Did you know, SQL Server 2008 Management Studio has an in-built option to generate a script that can help you restore an entire database alongwith the data? Compared to a .BAK file that can also be used to restore a database, a script lets you peek into the schema AND data (INSERT statements for rows within tables are automatically generated) before you restore it.

Unfortunately, this cool feature is hidden under layers of options and isn't easily discoverable unless a really discerning user points it out.


Steps to generate script:
1. Right click on a database name, choose Generate Scripts.. option under Tasks.. in the context menu
2. In the Generate and Publish Scripts wizard which appears choose the database object for which you want to generate a script
3. Under the Set Scripting Options, make sure to click on the Advanced button which reveals a bunch of more options.
4. In the new dialog box that opens up, scroll down to the last option in the General category and for Types of data to script, choose Schema and Data

Related:
HOW TO view parameter values of a stored procedure through SQL Profiler
Why are these Visual Studio Settings not enabled by default?
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
Posted in HOWTO, SQL Server | No comments
Newer Post Older Post Home

0 comments:

Post a Comment

Subscribe to: Post Comments (Atom)

Popular Posts

  • Windows 8 keyboard shortcuts
    Win + X   - context menu to access common features like Control Panel, Task Manager, File Explorer, Programs & Features, Run, Search etc...
  • Free JavaScript & jQuery learning resources
    There is a nice compilation of JavaScript & jQuery learning resources in this community wiki on StackOverflow.com . I picked those which...
  • My 30-day personal project - watch 100 hours of Pluralsight videos
    Inspired by Matt Cutts' 30-day challenges , I plan to watch 100 hours of Pluralsight online videos to get up-to-date with current ...
  • 10 ways to make laptop battery last longer
    Paraphrased from a Right Choice magazine article with my own opinions: Keep the brightness of the screen as low as possible. If portability ...
  • Archive tweets & favorites with Google Reader
    There are numerous ways to archive tweets but rather than use yet another tool, I prefer using Google Reader to preserve the tweets I mark ...
  • What is the difference between Browser Mode & Document Mode in IE
    If you're a web developer and your job actively involves building web pages that work the same in all browsers including the last three ...
  • Words that leave Google Instant speechless
    2600 Magazine has compiled a list of objectionable words that Google Instant has blacklisted. Several volunteers have submitted blackliste...
  • A new JavaScript Reference to bookmark
    For years, the JavaScript section at W3Schools.com has been a indispensable source of reference for me . It will now not be my only source. ...
  • India ranks fourth in Internet usage
    Deepak Shenoy informs that as per Telecom Regulatory Authority of India (TRAI) data, India has nearly 10 million Broadband connections in ...
  • Look what Google Goggles visual search can do
    Google Goggles is a visual search application available currently for Android powered phones. It may possibly be available for phones of oth...

Categories

  • AJAX
  • Android
  • APIs
  • App
  • ASP
  • ASP.NET
  • ASP.NET-MVC
  • Azure
  • Azure SQL Database
  • AzureInPictures
  • Bing
  • Book Review
  • Bookmarklet
  • Browsers
  • C#
  • chart
  • Chrome
  • Cloud
  • CSS
  • CSS3
  • DidYouKnow
  • E-Commerce
  • Excel
  • FB
  • Fiddler
  • Firefox
  • Gadgets
  • GeoLocation
  • GMail
  • Google
  • Google Docs
  • Google Reader
  • Health
  • Hotmail
  • HOWTO
  • HTML
  • HTML/CSS
  • HTML5
  • Humor
  • Hyderabad
  • IE
  • IIS
  • India
  • Internet
  • IT
  • Javascript
  • jQuery
  • JSON
  • JSONP
  • Laptop
  • Learning Resources
  • Lists
  • Map
  • Metrics
  • Microsoft
  • miscellaneous
  • Mobile
  • NAPA
  • Office365
  • Opera
  • PDF
  • Performance
  • Personal
  • PHP
  • PM
  • PowerShell
  • Privacy
  • Programming
  • Rant
  • Safari
  • Science
  • Search Engines
  • SearchEngines
  • Security
  • SEO
  • Sharepoint
  • SharePoint2013
  • Silverlight
  • Software Engineering
  • Solutions
  • SQL Azure
  • SQL Server
  • TFS
  • Tip
  • Tips
  • Tools
  • Tools/Utilities
  • Trivia
  • TWIL
  • Twitter
  • UX
  • VM
  • VS.NET
  • VS2010
  • VS2012
  • WCF
  • WebApps
  • Websites
  • WF
  • Windows Phone
  • Windows7
  • Windows8
  • Word
  • WP7
  • WPF

Blog Archive

  • ►  2013 (112)
    • ►  October (16)
    • ►  September (14)
    • ►  August (8)
    • ►  July (8)
    • ►  June (13)
    • ►  May (12)
    • ►  April (12)
    • ►  March (8)
    • ►  February (15)
    • ►  January (6)
  • ►  2012 (127)
    • ►  December (11)
    • ►  November (14)
    • ►  October (13)
    • ►  September (14)
    • ►  August (16)
    • ►  July (16)
    • ►  June (6)
    • ►  May (5)
    • ►  April (11)
    • ►  March (12)
    • ►  February (7)
    • ►  January (2)
  • ▼  2011 (98)
    • ▼  December (5)
      • Indian comparison shopping sites
      • HOW TO back up a database (schema and data) as a S...
      • Fastest dictionary on the web - thefreedictionary.com
      • Get over pesky layout/design changes, use keyboard...
      • HOW TO take a screenshot of any screen on Samsung ...
    • ►  November (2)
    • ►  October (5)
    • ►  September (7)
    • ►  August (7)
    • ►  July (15)
    • ►  June (10)
    • ►  May (7)
    • ►  April (8)
    • ►  March (10)
    • ►  February (11)
    • ►  January (11)
  • ►  2010 (163)
    • ►  December (14)
    • ►  November (19)
    • ►  October (19)
    • ►  September (15)
    • ►  August (18)
    • ►  July (17)
    • ►  June (20)
    • ►  May (17)
    • ►  April (19)
    • ►  March (5)
Powered by Blogger.

About Me

Unknown
View my complete profile