Login or Sign Up to become a member!
LessThanDot Sit Logo

LessThanDot

Data Management

Less Than Dot is a community of passionate IT professionals and enthusiasts dedicated to sharing technical knowledge, experience, and assistance. Inside you will find reference materials, interesting technical discussions, and expert tips and commentary. Once you register for an account you will have immediate access to the forums and all past articles and commentaries.

LTD Social Sitings

Lessthandot twitter Lessthandot Linkedin Lessthandot friendfeed Lessthandot facebook Lessthandot rss

Note: Watch for social icons on posts by your favorite authors to follow their postings on these and other social sites.

Your profile

    Search

    XML Feeds

    Google Ads

    « Presenting "Filegroups: Putting The Pieces Together" for WiSSUGSQL Server Auditing: Managing Your Audits »
    comments

    SQL Server 2008 has the Script Data option inside the script wizard.

    You would right click on the database, select Tasks-->Generate Scripts-->Pick the DB
    and then you would be presented with scripting options, one of the options would be to script data, this is located under Table/View options. See the image below of how it looks like

    In SQL Server 2012, this has changed and is kind of buried. Here is how to find it now.

    Right click on the database, select Tasks-->Generate Scripts-->Set Scripting Options-->Advanced. Scroll down to Types of data to script

    Now you can select Schema only, Data only, Schema and Data. See image below of what the options should look like

    Don't forget to install the SSMS Toolspack, that will enable you to script just one table or just results from a query as well

    About the Author

    User bio imageDenis has been working with SQL Server since version 6.5. Although he worked as an ASP/JSP/ColdFusion developer before the dot com bust, he has been working exclusively as a database developer/architect since 2002. In addition to English, Denis is also fluent in Croatian and Dutch, but he can curse in many other languages and dialects (just ask the SQL optimizer) He lives in Princeton, NJ with his wife and three kids.
    Social SitingsTwitterFacebookLinkedInHomePageFlickrLTD RSS Feed
    518 views
    scripting
    Instapaper

    6 comments

    Comment from: Naomi Nosonovsky [Member]
    Naomi Nosonovsky I believe SQL Server 2008 R2 also has this option in Advanced Options
    01/02/12 @ 19:07
    Comment from: AaronBertrand [Visitor] · http://sqlsentry.net/
    AaronBertrand Naomi, this option is new for SSMS in SQL Server 2012. I don't think you'll see this in earlier versions unless you're talking about some add-in.
    01/02/12 @ 20:03
    Comment from: Naomi Nosonovsky [Member]
    Naomi Nosonovsky I just opened again my SQL Server 2008 R2. I right click on the database, select Tasks / Generate Scripts, then the Wizard comes up and it has Set Scripting Options page. On this page I go to Advanced settings and I see exactly this 'Types of Data to Script' where I can chose the 'Schema and data'.

    So, may be I am missing something, but it looks to me exactly the same as I have.
    01/03/12 @ 08:50
    Comment from: Naomi Nosonovsky [Member]
    Naomi Nosonovsky May be Denis was talking about an option in SSMS (like, for example, Tools/Options) ? If so, then it should be accessed from a different way?
    01/03/12 @ 08:53
    Comment from: SQLDenis [Member] Email
    SQLDenis I added the image of what SQL Server 2008 looks like
    01/03/12 @ 09:06
    Comment from: Naomi Nosonovsky [Member]
    Naomi Nosonovsky May be it was changed in SQL Server 2008 R2 as I see the exactly same image as the second image (except for Denali as the version option)
    01/03/12 @ 09:49

    Leave a comment


    Your email address will not be revealed on this site.

    Your URL will be displayed.
    (Line breaks become <br />)
    (Name, email & website)
    (Allow users to contact you through a message form (your email will not be revealed.)