dbTalk Databases Forums  

Insert All Columns

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss Insert All Columns in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Derek Hart
 
Posts: n/a

Default Insert All Columns - 05-04-2006 , 01:20 PM






I want to copy a table of data from a source SQL Server to a destination SQL
Server. The destination will be empty. The destination may not have some
fields that the source has, but the source will have all the fields the
destination has. DTS seems to want to name every field, but I want to do an
insert without having to name the fields every time. Is there a way to
insert all the fields "Insert Into NewDatabase.myTable Select * From
OldDatabase?



Reply With Quote
  #2  
Old   
BigSam
 
Posts: n/a

Default RE: Insert All Columns - 05-05-2006 , 03:30 PM






If you are using one database then you should be able to use a SQL Task to
create a table & run your Insert statement.
If you want to move your data from one database to another you cannot do as
you propose, because you need multiple connection objects. If needed run a
SQL Task to create the table with the connection associated with the
destination. Then create & run a Transform Data Task to copy the data from
the source connection to the destination connection. Your Transform Data Task
can use a 'Select * from table' or the entire table as the source. The
Transformation will then insert the fields based on the transformation(s)
into the destination database.

For a good primer on DTS go to SQLDTS.com. An excellent source of
information & examples.

"Derek Hart" wrote:

Quote:
I want to copy a table of data from a source SQL Server to a destination SQL
Server. The destination will be empty. The destination may not have some
fields that the source has, but the source will have all the fields the
destination has. DTS seems to want to name every field, but I want to do an
insert without having to name the fields every time. Is there a way to
insert all the fields "Insert Into NewDatabase.myTable Select * From
OldDatabase?




Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.