Search code examples
sql-serverdatabase-migrationdata-migration

how to move views quickly from sql server 2008r2 to 2012?


I am currently on migrating data from sql server 2008r2 to sql server 2012

I have around 100 views on 2008r2 that need to be 'move' to 2012.

The database, tables, schema ... keep the same name.

I am just wondering, rather than copying and pasting those 'views' in sql, is there a more efficient way to create those 100 views on 2012?


Solution

  • Can't post comments yet. Here's a simple guide to Generating Scripts from a Database in SSMS.

    Right click on the Database you want to move the views FROM in SQL Server Management Studio

    Tasks --> Generate Scripts

    A Generate and Publish wizard will appear. In the Choose Objects part, select VIEWS. Click Next.

    In Set Scripting Options you can decide where the script should appear - as a file, in the clipboard, to a new query window. At this point you can click next to end and the script should be generated, however it might be worth noting the ADVANCED button in Set Scripting Options.

    The Advanced options allow you to set a lot of things. For example, the default script makes CREATE scripts, but the option Script Drop and Create allows for Drop and Create, Create or Drop only. There are a lot of options in here often overlooked and for a lot of simple database management, especially copying structures or data, it can be helpful to get to know these options.