dbTalk Databases Forums  

DTC transaction

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


Discuss DTC transaction in the microsoft.public.sqlserver.dts forum.



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

Default DTC transaction - 01-28-2004 , 09:51 AM






Hello, I am new to MS-SQL server and am trying to do something some of you have done before.

I am attempting to build a DTC that will run two sql statements in one transaction.

First SQL statement-clear the table I am working with
delete from APPDEV.IVRtrst

Second SQL statement-grab data from another datasource(mySQL) and insert it into table I am working with
insert into APPDEV.IVRtrst (tknum, cunum, tkstat) values (select tt.ttid, tt.cunum, case when tk.tkstatcode = 'C' then 'CLOSED' else 'OPEN' end as STATUS from ticket tt inner join task tk on(tt.ttid = tk.ttid)

I first tried this with the following code:
transation;
first sql statement;
second sql statement;
commit;

then I read about the GO statement and tried this:
first sql statement
GO
second sql statement

I get an error now
Error Source: Microsoft OLE DB Provider for ODBC Drivers

Error Description:[MySQL][ODBC 3.51 Driver][mysqld-3.23.58-log]You have an error in your SQL syntax near 'GO

insert into APPDEV.IVRtrst (select tt.ttid, tt.cunum, case when tk.tkstat' at line 3

Context: Error calling GetColumnInfo. Your provider does not support all the interfaces/methods required by DTS.

Can anyone help, I am still trying some differnt things, but really need to get this working and I feel that it can, Thanks, calvin

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

Default Re: DTC transaction - 01-28-2004 , 11:12 AM






Remember not ALL drivers support transactions so I would do this

1 * ExecuteSQL task with your first statement (No GO)
1 * ExecuteSQL task with your second statement (No GO)

Join the two together with an On Success Constraint

In the workflow properties for each task

Check Join transaction if present and Rollback transaction on failure

at the package level in the properties enable transactions.




--
--

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


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

Quote:
Hello, I am new to MS-SQL server and am trying to do something some of you
have done before.

I am attempting to build a DTC that will run two sql statements in one
transaction.

First SQL statement-clear the table I am working with
delete from APPDEV.IVRtrst

Second SQL statement-grab data from another datasource(mySQL) and insert
it into table I am working with
insert into APPDEV.IVRtrst (tknum, cunum, tkstat) values (select tt.ttid,
tt.cunum, case when tk.tkstatcode = 'C' then 'CLOSED' else 'OPEN' end as
STATUS from ticket tt inner join task tk on(tt.ttid = tk.ttid)
Quote:
I first tried this with the following code:
transation;
first sql statement;
second sql statement;
commit;

then I read about the GO statement and tried this:
first sql statement
GO
second sql statement

I get an error now
Error Source: Microsoft OLE DB Provider for ODBC Drivers

Error Description:[MySQL][ODBC 3.51 Driver][mysqld-3.23.58-log]You have an
error in your SQL syntax near 'GO

insert into APPDEV.IVRtrst (select tt.ttid, tt.cunum, case when tk.tkstat'
at line 3

Context: Error calling GetColumnInfo. Your provider does not support all
the interfaces/methods required by DTS.

Can anyone help, I am still trying some differnt things, but really need
to get this working and I feel that it can, Thanks, calvin




Reply With Quote
  #3  
Old   
calvin23
 
Posts: n/a

Default Re: DTC transaction - 01-28-2004 , 03:16 PM



Allan, I have figured more out since the last email. But still have a problem with an Execute SQL statement using two connections.

I figured how to
-join the two together wth an On Sucess Constraint
-in workflow properties for each task, check Join Transaction if present AND Rollback transaction on failure
-at the package level I enabled transactions by checking Use transactions AND Commit on successful package completion on the Advanced tab of the DTS package properties

I do get an error message when I attempt to execute the DTS though. I think I need to turn on a service on the box. Here is my error message:

Error Source : Microsoft Data Transformation Services (DTS) Package

Error Description : The Microsoft Distributed Transaction Coordinator (MSDTC service) is not available.

I will comb through my server to make sure this service is started.

Any idea's on the Execute SQL task using two connections would be appreciated though. Thanks and have a good Wednesday, calvin

----- Allan Mitchell wrote: -----

Remember not ALL drivers support transactions so I would do this

1 * ExecuteSQL task with your first statement (No GO)
1 * ExecuteSQL task with your second statement (No GO)

Join the two together with an On Success Constraint

In the workflow properties for each task

Check Join transaction if present and Rollback transaction on failure

at the package level in the properties enable transactions.




--
--

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


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

Quote:
Hello, I am new to MS-SQL server and am trying to do something some of you
have done before.
I am attempting to build a DTC that will run two sql statements in one
transaction.
First SQL statement-clear the table I am working with
delete from APPDEV.IVRtrst
Second SQL statement-grab data from another datasource(mySQL) and insert
it into table I am working with
insert into APPDEV.IVRtrst (tknum, cunum, tkstat) values (select tt.ttid,
tt.cunum, case when tk.tkstatcode = 'C' then 'CLOSED' else 'OPEN' end as
STATUS from ticket tt inner join task tk on(tt.ttid = tk.ttid)
Quote:
I first tried this with the following code:
transation;
first sql statement;
second sql statement;
commit;
then I read about the GO statement and tried this:
first sql statement
GO
second sql statement
I get an error now
Error Source: Microsoft OLE DB Provider for ODBC Drivers
Error Description:[MySQL][ODBC 3.51 Driver][mysqld-3.23.58-log]You have an
error in your SQL syntax near 'GO
insert into APPDEV.IVRtrst (select tt.ttid, tt.cunum, case when tk.tkstat'
at line 3
Context: Error calling GetColumnInfo. Your provider does not support all
the interfaces/methods required by DTS.
Can anyone help, I am still trying some differnt things, but really need
to get this working and I feel that it can, Thanks, calvin





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

Default Re: DTC transaction - 01-28-2004 , 03:30 PM



You need to look towards linked servers then

--
--

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


"calvin23" <rduke (AT) cavtel (DOT) com> wrote

Quote:
Allan, I can do what you suggested with the first SQL statement(delete
from APPDEV.IVRtrst) but the second SQL statement uses two different
connections(insert into APPDEV.IVRtrst(table on MSSQL box) select a,b,c from
ticket (table on mySQL box) so the Execute SQL won't work as I can tell. Is
there another tool for this type of operation?
Quote:
Once the I can get the second SQL statement to work in some type of tool,
how do I join the two together with an On Success Constraint?

Thanks in advance for any help you can lend, calvin

----- Allan Mitchell wrote: -----

Remember not ALL drivers support transactions so I would do this

1 * ExecuteSQL task with your first statement (No GO)
1 * ExecuteSQL task with your second statement (No GO)

Join the two together with an On Success Constraint

In the workflow properties for each task

Check Join transaction if present and Rollback transaction on failure

at the package level in the properties enable transactions.




--
--

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


"calvin23" <anonymous (AT) discussions (DOT) microsoft.com> wrote in message
news:78204040-D52D-488E-9E3C-AC14D5D34161 (AT) microsoft (DOT) com...
Hello, I am new to MS-SQL server and am trying to do something some
of you
have done before.
I am attempting to build a DTC that will run two sql statements in
one
transaction.
First SQL statement-clear the table I am working with
delete from APPDEV.IVRtrst
Second SQL statement-grab data from another datasource(mySQL) and
insert
it into table I am working with
insert into APPDEV.IVRtrst (tknum, cunum, tkstat) values (select
tt.ttid,
tt.cunum, case when tk.tkstatcode = 'C' then 'CLOSED' else 'OPEN' end
as
STATUS from ticket tt inner join task tk on(tt.ttid = tk.ttid)
I first tried this with the following code:
transation;
first sql statement;
second sql statement;
commit;
then I read about the GO statement and tried this:
first sql statement
GO
second sql statement
I get an error now
Error Source: Microsoft OLE DB Provider for ODBC Drivers
Error Description:[MySQL][ODBC 3.51 Driver][mysqld-3.23.58-log]You
have an
error in your SQL syntax near 'GO
insert into APPDEV.IVRtrst (select tt.ttid, tt.cunum, case when
tk.tkstat'
at line 3
Context: Error calling GetColumnInfo. Your provider does not
support all
the interfaces/methods required by DTS.
Can anyone help, I am still trying some differnt things, but
really need
to get this working and I feel that it can, Thanks, calvin






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

Default Re: DTC transaction - 01-28-2004 , 03:34 PM



Yep DTC needs to be started

EM | Support Services |Distributed Transaction CoOrdinator

--
--

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


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

Quote:
Allan, I have figured more out since the last email. But still have a
problem with an Execute SQL statement using two connections.

I figured how to
-join the two together wth an On Sucess Constraint
-in workflow properties for each task, check Join Transaction if present
AND Rollback transaction on failure
-at the package level I enabled transactions by checking Use transactions
AND Commit on successful package completion on the Advanced tab of the DTS
package properties
Quote:
I do get an error message when I attempt to execute the DTS though. I
think I need to turn on a service on the box. Here is my error message:

Error Source : Microsoft Data Transformation Services (DTS) Package

Error Description : The Microsoft Distributed Transaction Coordinator
(MSDTC service) is not available.

I will comb through my server to make sure this service is started.

Any idea's on the Execute SQL task using two connections would be
appreciated though. Thanks and have a good Wednesday, calvin

----- Allan Mitchell wrote: -----

Remember not ALL drivers support transactions so I would do this

1 * ExecuteSQL task with your first statement (No GO)
1 * ExecuteSQL task with your second statement (No GO)

Join the two together with an On Success Constraint

In the workflow properties for each task

Check Join transaction if present and Rollback transaction on failure

at the package level in the properties enable transactions.




--
--

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


"calvin23" <anonymous (AT) discussions (DOT) microsoft.com> wrote in message
news:78204040-D52D-488E-9E3C-AC14D5D34161 (AT) microsoft (DOT) com...
Hello, I am new to MS-SQL server and am trying to do something some
of you
have done before.
I am attempting to build a DTC that will run two sql statements in
one
transaction.
First SQL statement-clear the table I am working with
delete from APPDEV.IVRtrst
Second SQL statement-grab data from another datasource(mySQL) and
insert
it into table I am working with
insert into APPDEV.IVRtrst (tknum, cunum, tkstat) values (select
tt.ttid,
tt.cunum, case when tk.tkstatcode = 'C' then 'CLOSED' else 'OPEN' end
as
STATUS from ticket tt inner join task tk on(tt.ttid = tk.ttid)
I first tried this with the following code:
transation;
first sql statement;
second sql statement;
commit;
then I read about the GO statement and tried this:
first sql statement
GO
second sql statement
I get an error now
Error Source: Microsoft OLE DB Provider for ODBC Drivers
Error Description:[MySQL][ODBC 3.51 Driver][mysqld-3.23.58-log]You
have an
error in your SQL syntax near 'GO
insert into APPDEV.IVRtrst (select tt.ttid, tt.cunum, case when
tk.tkstat'
at line 3
Context: Error calling GetColumnInfo. Your provider does not
support all
the interfaces/methods required by DTS.
Can anyone help, I am still trying some differnt things, but
really need
to get this working and I feel that it can, Thanks, calvin






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.