Generate SQL Queries to Backup or Alter Views Within MS SQL

In this guide, you’ll learn how to easily backup an existing SQL view and alter it safely using SQL commands generated by MS SQL iteself.

Create a Backup Copy of the Existing View

Before making changes to an existing view, it is always recommended to create a backup copy. 

The easiest way to backup a view is to create the same view with a different name. 

To backup a view, right click on it & go to CREATE TO > New Query Editor

It will output a CREATE command as follows:


You can simply change the view name and rerun to create a new view.

ALTER an Existing View

To alter a view, right click on it & go to ALTER TO > New Query Editor

Similar to the create query it will output an alter query in a new window as follows:


You can now do any changes to this query and execute the alter.

0 Comments