-2

I am presently using SQL Server 2008. I want to move the entire applications and database to SQL Server 2016 without data. i.e. I don't want to copy the entire data but I need all the tables and everything from the previous server. Can please anyone help me with this?

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
  • 1
    This post shows no research or effort. – dfundako Jun 13 '18 at 18:28
  • Welcome to Stack Overflow! This is a site where programmers write their own code and share issues with a specific problem after trying to solve it on their own. If, after **[doing more research](https://meta.stackoverflow.com/q/261592)**, you have a specific problem, please edit your post to share [examples of your code and relevant data](https://stackoverflow.com/help/mcve) and some background info. You might also want to read ["How to Ask"](https://stackoverflow.com/help/how-to-ask) and [these tips](https://meta.stackoverflow.com/q/347937). – Adrian W Jun 13 '18 at 18:42

1 Answers1

2

You'll want to script out each database. To do so:

  • right click on the database
  • tasks
  • generate scripts
  • using the wizard, choose all the data objects you want (tables, views, etc.) or all of them
  • save to a location
  • open the file from that location

boom, there is your code set up all your tables, etc. for your database!

Just repeat for each database you want to 'copy'. Just remember (as requested) each table will have no data in it. Alternatively you can backup and restore each database and then truncate each table, that is probably a lot more work though.

sniperd
  • 5,124
  • 6
  • 28
  • 44