Groups | Blog | Home
all groups > sql server dts > june 2004 >

sql server dts : dts transaction


news.microsoft.com
6/25/2004 6:03:02 PM
Hi,

I am trying to create a dts package to import about 10 tables from access to
SQL server using the DTS import and export wizard. I saved the dts package
and tried to add a work flow to make sure the person table is inserted first
before the other table. But how can I roll back the entire transformation
if one of the table failed?

thanks

Pauli

pauli
6/26/2004 5:59:10 AM
Hi thanks for the reply.

I see the transaction in the package properties, but I do not see the " Join
Transaction if present or Rollback... " in the workflow properties?

Also, please advise if what I am doing is correct. I am trying to set up a
package that will import about 10 tables from access database. Theres one
main table called person with about 9 other tables that include education
and employment.. We will received these databases from about 15 partners.
Heres what I am doing in my package.
1. I import the the access database into a temp database that I have
created in SQL Server.
2. I added a column name person_accessID into the person table in the
actual database. This is necessary because there is a person_ID identity
field. I need to update the other tables in the temp database with the new
person_id when they are inserted.
3. I insert the person table first into the database. I run a stored
procedure that select the person_ID and person_accessID from the person
table and updates the other tables in the temp database with this new ID
4. Then I run a transform data task to insert the rest of the data into
the database.

Is that the correct way to do this?

Thanks for you help.

Pauli

[quoted text, click to view]

Allan Mitchell
6/26/2004 8:32:05 AM
You need to enable transactions in the package (Package Properties)
In ech step that you want to enroll in the transaction you need to set

"Join Transaction if present"
"Rollback Transaction on failure"

in the workflow properties

--
--

Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
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


[quoted text, click to view]

Nigel Rivett
6/26/2004 11:16:01 AM
Why use dts t all for this?
Maybe use it for the import into the staging database if you wish but the rest should be an SP - just do the transaction control in the SP.

I would call the package from the SP rather than vice versa but it's up to you.

pauli
6/26/2004 2:39:40 PM
Thanks, I am new to DTS, I was wondering if you would do it differently
than what I have.


[quoted text, click to view]

Allan Mitchell
6/26/2004 3:37:13 PM
If you are using a proc to do the rest then why not do everything in a proc
and use a transaction over all this work?




[quoted text, click to view]

Allan Mitchell
6/27/2004 6:40:17 AM
If I had 90% of my stuff in a stored proc and the rest of the data
migration/manipulation was not excessive and could be done in TSQL then I
would use all TSQL in a proc.



--
--

Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
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


[quoted text, click to view]

AddThis Social Bookmark Button