Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Copying views from one database to another

Author  Topic 

AdamWest
Constraint Violating Yak Guru

360 Posts

Posted - 2010-09-14 : 10:10:10
HI I have views in Database A and wanted to copy them to Database B.

I did an Import into B but it places them under tables, not under views.
Is this a problem, and/0r how can i get them to import to "Views" ?

X002548
Not Just a Number

15586 Posts

Posted - 2010-09-14 : 10:15:56
I would just script the views...what's an import?

Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

Add yourself!
http://www.frappr.com/sqlteam



Go to Top of Page

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2010-09-14 : 10:16:33
Just script it and then create it in the new database.


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2010-09-14 : 10:17:17

Brett the sniper


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

AdamWest
Constraint Violating Yak Guru

360 Posts

Posted - 2010-09-14 : 10:48:06
You script the view, meaning you have to re-write it, or you can save it as a file and then what do yo do?
Go to Top of Page

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2010-09-14 : 11:00:49
In Object Explorer
expand databases
expand your db
expand views
right click the view and choose create ...


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2010-09-14 : 11:23:00
"and then what do yo do?"

Execute the script (on the new, target, server / database)
Go to Top of Page
   

- Advertisement -