skip to Main Content

It appears that with non Azure SQL DBs you can right click the DB and then go to ‘Tasks’ to be able to script out your views. I don’t have that option with my Azure SQL. I can always script each one individually, however, was hoping for a quicker way to do it as I have 40-50 views.

2

Answers


  1. Chosen as BEST ANSWER

    The response by Dijkgraaf gives the definition of the view which will allow me to create a larger script to recreate my views. https://dataedo.com/kb/query/azure-sql/list-views-with-their-scripts


  2. Does sp_helptext exist/work in Azure? If so, set SSMS to return results as text instead of table and execute:

    exec sp_helptext 'schema.objectname'
    

    It should return the create script. (Technically it returns a table with a single column named [Text] with a row for each line of the script.)

    It works with views, stored procs, functions and triggers.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search