copy a view to another db

copy a view to another db

Post by Evan » Tue, 26 Mar 2002 01:13:55



ehm, how do you copy a view from one DB to another one, I used the import
function, but that failed....it wrote all my views as tbl's.....

could someone shine some light on this?

Evan

 
 
 

copy a view to another db

Post by Narayana Vyas Kondredd » Tue, 26 Mar 2002 01:35:55


You can simply script the view in Enterprise Manager, and run the script on
the target database.

DTS can transfer views too. Can you tell us how exactly you used the 'import
function'.
--
HTH,
Vyas, MVP (SQL Server)

http://vyaskn.tripod.com/


ehm, how do you copy a view from one DB to another one, I used the import
function, but that failed....it wrote all my views as tbl's.....

could someone shine some light on this?

Evan

 
 
 

copy a view to another db

Post by Evan » Tue, 26 Mar 2002 03:04:25


I'm sorry I'm all new to all of this,

I right clicked the db, went to all tasks, and then import data .....it
worked fine for some tables in another database, but the views that I
selected as well, where just converted to tables and shown in the database
where I imported it to as tables.

 I guess that wasnt' the way to do this eh?


> You can simply script the view in Enterprise Manager, and run the script
on
> the target database.

> DTS can transfer views too. Can you tell us how exactly you used the
'import
> function'.
> --
> HTH,
> Vyas, MVP (SQL Server)

> http://vyaskn.tripod.com/



> ehm, how do you copy a view from one DB to another one, I used the import
> function, but that failed....it wrote all my views as tbl's.....

> could someone shine some light on this?

> Evan

 
 
 

copy a view to another db

Post by Narayana Vyas Kondredd » Tue, 26 Mar 2002 03:18:29


On client computer with SQL Client tools installed, go to Start -> Run, type
dtswiz and hit enter. In here, choose to transfer objects and data, and in
one of the screens you should be able to select the views.
--
HTH,
Vyas, MVP (SQL Server)

http://vyaskn.tripod.com/


I'm sorry I'm all new to all of this,

I right clicked the db, went to all tasks, and then import data .....it
worked fine for some tables in another database, but the views that I
selected as well, where just converted to tables and shown in the database
where I imported it to as tables.

 I guess that wasnt' the way to do this eh?


> You can simply script the view in Enterprise Manager, and run the script
on
> the target database.

> DTS can transfer views too. Can you tell us how exactly you used the
'import
> function'.
> --
> HTH,
> Vyas, MVP (SQL Server)

> http://vyaskn.tripod.com/



> ehm, how do you copy a view from one DB to another one, I used the import
> function, but that failed....it wrote all my views as tbl's.....

> could someone shine some light on this?

> Evan

 
 
 

copy a view to another db

Post by Evan » Tue, 26 Mar 2002 04:38:29


THANK YOU VERY MUCH! :o))))
I'll go try it out



> On client computer with SQL Client tools installed, go to Start -> Run,
type
> dtswiz and hit enter. In here, choose to transfer objects and data, and in
> one of the screens you should be able to select the views.
> --
> HTH,
> Vyas, MVP (SQL Server)

> http://vyaskn.tripod.com/



> I'm sorry I'm all new to all of this,

> I right clicked the db, went to all tasks, and then import data .....it
> worked fine for some tables in another database, but the views that I
> selected as well, where just converted to tables and shown in the database
> where I imported it to as tables.

>  I guess that wasnt' the way to do this eh?


> > You can simply script the view in Enterprise Manager, and run the script
> on
> > the target database.

> > DTS can transfer views too. Can you tell us how exactly you used the
> 'import
> > function'.
> > --
> > HTH,
> > Vyas, MVP (SQL Server)

> > http://vyaskn.tripod.com/



> > ehm, how do you copy a view from one DB to another one, I used the
import
> > function, but that failed....it wrote all my views as tbl's.....

> > could someone shine some light on this?

> > Evan

 
 
 

copy a view to another db

Post by deni » Tue, 26 Mar 2002 07:18:29


Also what i typically do is

sp_help_text MyView


> THANK YOU VERY MUCH! :o))))
> I'll go try it out



> > On client computer with SQL Client tools installed, go to Start -> Run,
> type
> > dtswiz and hit enter. In here, choose to transfer objects and data, and
in
> > one of the screens you should be able to select the views.
> > --
> > HTH,
> > Vyas, MVP (SQL Server)

> > http://vyaskn.tripod.com/



> > I'm sorry I'm all new to all of this,

> > I right clicked the db, went to all tasks, and then import data .....it
> > worked fine for some tables in another database, but the views that I
> > selected as well, where just converted to tables and shown in the
database
> > where I imported it to as tables.

> >  I guess that wasnt' the way to do this eh?


> > > You can simply script the view in Enterprise Manager, and run the
script
> > on
> > > the target database.

> > > DTS can transfer views too. Can you tell us how exactly you used the
> > 'import
> > > function'.
> > > --
> > > HTH,
> > > Vyas, MVP (SQL Server)

> > > http://vyaskn.tripod.com/



> > > ehm, how do you copy a view from one DB to another one, I used the
> import
> > > function, but that failed....it wrote all my views as tbl's.....

> > > could someone shine some light on this?

> > > Evan

 
 
 

copy a view to another db

Post by Carlo » Wed, 27 Mar 2002 05:47:03


Evan,
The best way to go about objects is to script them. Then
you can save the script for future use. I do recommend to
script every single object you have in your database. The
scripts do not use a lot od=f space and you can use them
over and over.

To script the view, go to the view and right click on that
one and select all tasks. Then select Generate scripts. It
is going to open a box with the selected view at the right
hand, then just click OK. The system will ask you where to
save it, find the folder or directory where you want and
voila! you can use thsi view as many times as you want in
any database you need. Good luck!

Is going to look like this:
-------------------------------------------------
if exists (select * from dbo.sysobjects where id =
object_id(N'[dbo].[vAttorney]') and OBJECTPROPERTY(id,
N'IsView') = 1)
drop view [dbo].[vAttorney]
GO

SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO

CREATE VIEW dbo.vAttorney
AS
SELECT     RECORD_NUMBER, XXX001,  DESCRIPTION
FROM         dbo.ATTORNEY_PAR_TAB

GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO

--------------------------------------------

 
 
 

1. Copy Database Wizard can't copy *.mdf file while transfer DB from MSSQL7 to MSSQL2000

Situation:

Want to transfer some DB from MSSQL7 to MSSQL2000 via Copy Database
Wizard. The wizard successfully creates share OMWWIZc, switches DB into
single user mode, detaches DB and failes to copy MDF file

the error says "failed to copy \\...\DB.mdf file"

If somebody knows what is wrong help me find out, please.

--
Posted via http://dbforums.com

2. Moving data from 8.1.6.3 to another 8.1.7 machine

3. How to prevent deletion when using dbNavigator ?

4. HELP - using DTS to copy data from sql db to sql db

5. Mgr/ SQL Dev. for Bay area co. (rec)

6. sql2k -copy db wiz corrupt db?

7. JavAus'98

8. Reporting DB as copy of Transaction DB

9. Need FASTER Copy 30GB to 125GB DB to another DB

10. Error in DTS package copy 7.0 db to 2000 db

11. Copying DB to new DB

12. copy db and db users