Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member
The Database Publishing Wizard that was included in Visual Web Developer 2008 is not a part of Visual Studio Express 2012. If you go to the Database Explorer and right-click on your data connection, you'll see that the tool to get to that wizard is no longer available. That ability, however, to export the structure and data from one or more database tables is now available in SQL Server Management Studio for SQL Server 2012, and I'll show you how to do that here. I'm working with that same database, My Bookstore, this time seen through SQL Server Management Studio. I'll go to my database, My Bookstore. I'll right-click and choose Tasks > Generate Scripts, and that takes me to something called the Generate and Publish Scripts wizard. On the introduction screen, I'll click Next. Now, I'll indicate whether I want to script the entire database or only a single table.
Those are your choices. I'll export just one database table: My Author's table. I'll select it and then click Next. Now I'll indicate how I want to save my output. I'm going to save a script file to a particular location on disk, so I'll select this first option for the output type and the default option for a Save to File. And then here's a very important step. I'll click the Advanced button, and this takes me to a list of options for my scripting. There are many options available. I'm just going to change two of them. First of all, I'm going to add both Drop and Create statements, so I can use the resulting script to remove an existing table and create a new one. I'll change the option to Script DROP and CREATE. Then I'll scroll down to the bottom of the first list and I'll change the Types of data to script from the default of Schema Only to Schema and Data. And again, there are many other options available that you can investigate. I'll click OK and that takes me back to the Scripting Options window. Now I'll specify which file I want to create. I'll browse, and for convenience, I'll put the resulting file on my desktop, and I'll name the file authors.SQL. When I click Save, I'm taken back to the Scripting Options window and then I'll click Next. I'll review my selections and click Next again, and the export is executed. If you see Success under the Result column, it's all good. I'll click Finish to close the wizard.
I'll minimize all of my software tools to return to the desktop. And then I'll go to the resulting file, author.SQL. I'll open that in the text editor, and you can use any text editor you like. I'm using TextPad. And I'll scroll down to show that the resulting SQL file has SQL statements to create the table and all of its structure, plus insert statements for all of the data. You'll find one insert statement for each of the original rows that was in the database. You can now take this resulting script and use it to create the table on your production site and populate it with your existing data.
Get unlimited access to all courses for just $25/month.Become a member
61 Video lessons · 100008 Viewers
56 Video lessons · 113078 Viewers
71 Video lessons · 81923 Viewers
131 Video lessons · 39312 Viewers
Access exercise files from a button right under the course name.
Search within course videos and transcripts, and jump right to the results.
Remove icons showing you already watched videos if you want to start over.
Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.
Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.