How to copy views from one database to another database

前端 未结 5 1783
萌比男神i
萌比男神i 2020-12-14 02:07

I have two databases with same structure in MS SQL server.

I\'d like to copy all views another database.

I tried to use Export data functionality by DTS (tha

5条回答
  •  Happy的楠姐
    2020-12-14 02:42

    I know this is a VERY late answer, however i think this might prove usefull for some (if you do not have a gui like sql server management studio)

    select * 
    from INFORMATION_SCHEMA.VIEWS
    

    here you get a column named "view_definition" in sql server, (this works on databases from other vendors too)

提交回复
热议问题