dbTalk Databases Forums  

multi phase data pump example

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


Discuss multi phase data pump example in the microsoft.public.sqlserver.dts forum.



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

Default multi phase data pump example - 03-04-2004 , 08:31 PM






Allen,

Sorry to Bug you once again.


I added the following transformation in my code

Row Transform Function
' Copy each source column to the destination column
Function Main()
DTSDestination("c1") = DTSSource("c1")
DTSDestination("c2") = DTSSource("c2")
Main = DTSTransformStat_OK
End Function

---------

Insert Failure Function

Function InsertFailureMain()
InsertFailureMain = DTSTransformStat_SkipInsert
End Function

---------

Transform Failure Function

Function TransFailureMain()
TransFailureMain = DTSTransformStat_SkipInsert
End Function

---------


' Insert Success Function

Function InsertSuccessMain()
InsertSuccessMain = DTSTransformstat_OK
End Function

after that I executed the Package But I could able to
succeed Inserting the 3 rd record.

recap:

DATABASE 1 contains 3 records
DATABASE 2 contains 2 records( same as DATABASE 1 records)

Now after executing the Package.

Package should skip the 2 records which already exists.
But should Insert only the 3rd record..


Thanks in Advance.
Raj





Quote:
-----Original Message-----
OK I just built a package around what you want and
followed my example

I used your scripts

You must

1. Turn off FAST LOAD
2. Handle the "Insert Failure" phase
3. Handle the Transform Failure

It works.



--

Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.allisonmitchell.com - Expert SQL Server Consultancy.
www.SQLDTS.com - The site for all your DTS needs.
I support PASS - the definitive, global community
for SQL Server professionals - http://www.sqlpass.org


"Raj" <anonymous (AT) discussions (DOT) microsoft.com> wrote in
message
news:70b801c4022c$ae509630$a001280a (AT) phx (DOT) gbl...
ON DATABASE 1

create table sample1
(
c1 int not null primary key,
c2 int
)
go

insert into sample1 values(1,1)
insert into sample1 values(2,1)
insert into sample1 values(3,1)

go

select * from sample1

ON DATA BASE 2


create table sample1
(
c1 int not null primary key,
c2 int
)
go

insert into sample1 values(1,1)
go
insert into sample1 values(2,1)
go

select * from sample1


I had already selected MULTI DATA BASE PUMP Option.

In DTS Designer I established two OLE DB connections are
established for each DATA BASE
I added a Data Transform Task in between connections for
inserting the data from DATABASE 1 to DATABASE 2.

If I start executing this package it is errored out due
to
PRIMARY KEY violation.

My aim is by DTS package should executing by adding the
3rd record from the DATABASE1 TO DATABASE2
i.e., after executing both the tables should have the
Same
data.



Allen , posted this link this morning.

http://www.sqldts.com/default.aspx?282,1

It helped me a lot .. But still i could not able to
proceed.

I think I am missing something

so, please can any of you help how to proceed or any
example.



Thanks in Advance.

Raj






.

..




Reply With Quote
  #2  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: multi phase data pump example - 03-05-2004 , 12:26 AM






Check the FAST LOAD as well as changing your handlers to

Function InsertFailureMain()
InsertFailureMain = DTSTransformStat_OK
End Function

---------

Transform Failure Function

Function TransFailureMain()
TransFailureMain = DTSTransformStat_OK
End Function


--

Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.allisonmitchell.com - Expert SQL Server Consultancy.
www.SQLDTS.com - The site for all your DTS needs.
I support PASS - the definitive, global community
for SQL Server professionals - http://www.sqlpass.org


"Raj" <anonymous (AT) discussions (DOT) microsoft.com> wrote

Quote:
Allen,

Sorry to Bug you once again.


I added the following transformation in my code

Row Transform Function
' Copy each source column to the destination column
Function Main()
DTSDestination("c1") = DTSSource("c1")
DTSDestination("c2") = DTSSource("c2")
Main = DTSTransformStat_OK
End Function

---------

Insert Failure Function

Function InsertFailureMain()
InsertFailureMain = DTSTransformStat_SkipInsert
End Function

---------

Transform Failure Function

Function TransFailureMain()
TransFailureMain = DTSTransformStat_SkipInsert
End Function

---------


' Insert Success Function

Function InsertSuccessMain()
InsertSuccessMain = DTSTransformstat_OK
End Function

after that I executed the Package But I could able to
succeed Inserting the 3 rd record.

recap:

DATABASE 1 contains 3 records
DATABASE 2 contains 2 records( same as DATABASE 1 records)

Now after executing the Package.

Package should skip the 2 records which already exists.
But should Insert only the 3rd record..


Thanks in Advance.
Raj





-----Original Message-----
OK I just built a package around what you want and
followed my example

I used your scripts

You must

1. Turn off FAST LOAD
2. Handle the "Insert Failure" phase
3. Handle the Transform Failure

It works.



--

Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.allisonmitchell.com - Expert SQL Server Consultancy.
www.SQLDTS.com - The site for all your DTS needs.
I support PASS - the definitive, global community
for SQL Server professionals - http://www.sqlpass.org


"Raj" <anonymous (AT) discussions (DOT) microsoft.com> wrote in
message
news:70b801c4022c$ae509630$a001280a (AT) phx (DOT) gbl...
ON DATABASE 1

create table sample1
(
c1 int not null primary key,
c2 int
)
go

insert into sample1 values(1,1)
insert into sample1 values(2,1)
insert into sample1 values(3,1)

go

select * from sample1

ON DATA BASE 2


create table sample1
(
c1 int not null primary key,
c2 int
)
go

insert into sample1 values(1,1)
go
insert into sample1 values(2,1)
go

select * from sample1


I had already selected MULTI DATA BASE PUMP Option.

In DTS Designer I established two OLE DB connections are
established for each DATA BASE
I added a Data Transform Task in between connections for
inserting the data from DATABASE 1 to DATABASE 2.

If I start executing this package it is errored out due
to
PRIMARY KEY violation.

My aim is by DTS package should executing by adding the
3rd record from the DATABASE1 TO DATABASE2
i.e., after executing both the tables should have the
Same
data.



Allen , posted this link this morning.

http://www.sqldts.com/default.aspx?282,1

It helped me a lot .. But still i could not able to
proceed.

I think I am missing something

so, please can any of you help how to proceed or any
example.



Thanks in Advance.

Raj






.

.





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 - 2013, Jelsoft Enterprises Ltd.