dbTalk Databases Forums  

Update Table with DTS

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


Discuss Update Table with DTS in the microsoft.public.sqlserver.dts forum.



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

Default Update Table with DTS - 07-18-2004 , 07:40 PM






We would like to update the Customer Table in Northwind
database with DTS (As a testing).

We have created a DTS as follow but it doesn't run
successfully. Is there anything wrong ?

Function Main()
DTSDestination("ContactName") = DTSSource
("ContactName")
DTSDestination("CustomerID") = DTSSource
("CustomerID")
Main = DTSTransformStat_UpdateQuery
End Function

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

Default Re: Update Table with DTS - 07-18-2004 , 11:45 PM






OK

You have not mentioned

1. Errors
2. Tasks Used
3. Version of SQL Server
4. With what you want to update the table

You could simply use the ExecuteSQL task to do updates. The syntax you are
using requires the Data Driven Query Task which usually decides its hoice of
query from a flag in the source data. If you are using the DDQ, have you
set up your queries?




--
--

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


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

Quote:
We would like to update the Customer Table in Northwind
database with DTS (As a testing).

We have created a DTS as follow but it doesn't run
successfully. Is there anything wrong ?

Function Main()
DTSDestination("ContactName") = DTSSource
("ContactName")
DTSDestination("CustomerID") = DTSSource
("CustomerID")
Main = DTSTransformStat_UpdateQuery
End Function



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

Default Re: Update Table with DTS - 07-19-2004 , 01:08 AM



Dear Allan,

I am new to DTS and don't know Data Driven Query at all.
We have exported a couple of columns from a table. After
manuplination, we have to update the table with the
changed data.

We are using SQL Server 2000 SP3.
We want to update 3 columns + key of the table.
There is no query being prepared.

Thanks

Quote:
-----Original Message-----
OK

You have not mentioned

1. Errors
2. Tasks Used
3. Version of SQL Server
4. With what you want to update the table

You could simply use the ExecuteSQL task to do updates.
The syntax you are
using requires the Data Driven Query Task which usually
decides its hoice of
query from a flag in the source data. If you are using
the DDQ, have you
set up your queries?




--
--

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


"Paul" <anonymous (AT) discussions (DOT) microsoft.com> wrote in
message
news:2f43f01c46d28$f8f60a50$a501280a (AT) phx (DOT) gbl...
We would like to update the Customer Table in Northwind
database with DTS (As a testing).

We have created a DTS as follow but it doesn't run
successfully. Is there anything wrong ?

Function Main()
DTSDestination("ContactName") = DTSSource
("ContactName")
DTSDestination("CustomerID") = DTSSource
("CustomerID")
Main = DTSTransformStat_UpdateQuery
End Function


.


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

Default Re: Update Table with DTS - 07-19-2004 , 03:42 AM



One of the easiest ways to do this is to import your data into a staging
table and then issue TSQL against the tables.
The DDQ is not complex but it does take a bit of working out.
Is this X Server or same server. If == same server then you could simply
use 3 part naming and do your updates.

What is the source of your data?

--

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

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


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

Quote:
Dear Allan,

I am new to DTS and don't know Data Driven Query at all.
We have exported a couple of columns from a table. After
manuplination, we have to update the table with the
changed data.

We are using SQL Server 2000 SP3.
We want to update 3 columns + key of the table.
There is no query being prepared.

Thanks

-----Original Message-----
OK

You have not mentioned

1. Errors
2. Tasks Used
3. Version of SQL Server
4. With what you want to update the table

You could simply use the ExecuteSQL task to do updates.
The syntax you are
using requires the Data Driven Query Task which usually
decides its hoice of
query from a flag in the source data. If you are using
the DDQ, have you
set up your queries?




--
--

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


"Paul" <anonymous (AT) discussions (DOT) microsoft.com> wrote in
message
news:2f43f01c46d28$f8f60a50$a501280a (AT) phx (DOT) gbl...
We would like to update the Customer Table in Northwind
database with DTS (As a testing).

We have created a DTS as follow but it doesn't run
successfully. Is there anything wrong ?

Function Main()
DTSDestination("ContactName") = DTSSource
("ContactName")
DTSDestination("CustomerID") = DTSSource
("CustomerID")
Main = DTSTransformStat_UpdateQuery
End Function


.




Reply With Quote
  #5  
Old   
Paul
 
Posts: n/a

Default Re: Update Table with DTS - 07-19-2004 , 07:28 PM



Source of data is a CSV file.

Do you mean staging table is a temporary table that I
import the CSV data ?

In what circumstances we use DDQ instead of staging table ?

Thanks

Quote:
-----Original Message-----
One of the easiest ways to do this is to import your data
into a staging
table and then issue TSQL against the tables.
The DDQ is not complex but it does take a bit of working
out.
Is this X Server or same server. If == same server then
you could simply
use 3 part naming and do your updates.

What is the source of your data?

--

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

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


"Paul" <anonymous (AT) discussions (DOT) microsoft.com> wrote in
message
news:2fc0e01c46d56$c2aeb0e0$a301280a (AT) phx (DOT) gbl...
Dear Allan,

I am new to DTS and don't know Data Driven Query at all.
We have exported a couple of columns from a table.
After
manuplination, we have to update the table with the
changed data.

We are using SQL Server 2000 SP3.
We want to update 3 columns + key of the table.
There is no query being prepared.

Thanks

-----Original Message-----
OK

You have not mentioned

1. Errors
2. Tasks Used
3. Version of SQL Server
4. With what you want to update the table

You could simply use the ExecuteSQL task to do updates.
The syntax you are
using requires the Data Driven Query Task which usually
decides its hoice of
query from a flag in the source data. If you are using
the DDQ, have you
set up your queries?




--
--

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


"Paul" <anonymous (AT) discussions (DOT) microsoft.com> wrote in
message
news:2f43f01c46d28$f8f60a50$a501280a (AT) phx (DOT) gbl...
We would like to update the Customer Table in
Northwind
database with DTS (As a testing).

We have created a DTS as follow but it doesn't run
successfully. Is there anything wrong ?

Function Main()
DTSDestination("ContactName") = DTSSource
("ContactName")
DTSDestination("CustomerID") = DTSSource
("CustomerID")
Main = DTSTransformStat_UpdateQuery
End Function


.



.


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

Default Re: Update Table with DTS - 07-20-2004 , 02:20 AM



You can use the DDQ here by all means but be aware that this operates on
rows 1 * 1. Importing into a staging table and using TSQL will, on a
largish table, get you better performance.

--

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

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


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

Quote:
Source of data is a CSV file.

Do you mean staging table is a temporary table that I
import the CSV data ?

In what circumstances we use DDQ instead of staging table ?

Thanks

-----Original Message-----
One of the easiest ways to do this is to import your data
into a staging
table and then issue TSQL against the tables.
The DDQ is not complex but it does take a bit of working
out.
Is this X Server or same server. If == same server then
you could simply
use 3 part naming and do your updates.

What is the source of your data?

--

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

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


"Paul" <anonymous (AT) discussions (DOT) microsoft.com> wrote in
message
news:2fc0e01c46d56$c2aeb0e0$a301280a (AT) phx (DOT) gbl...
Dear Allan,

I am new to DTS and don't know Data Driven Query at all.
We have exported a couple of columns from a table.
After
manuplination, we have to update the table with the
changed data.

We are using SQL Server 2000 SP3.
We want to update 3 columns + key of the table.
There is no query being prepared.

Thanks

-----Original Message-----
OK

You have not mentioned

1. Errors
2. Tasks Used
3. Version of SQL Server
4. With what you want to update the table

You could simply use the ExecuteSQL task to do updates.
The syntax you are
using requires the Data Driven Query Task which usually
decides its hoice of
query from a flag in the source data. If you are using
the DDQ, have you
set up your queries?




--
--

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


"Paul" <anonymous (AT) discussions (DOT) microsoft.com> wrote in
message
news:2f43f01c46d28$f8f60a50$a501280a (AT) phx (DOT) gbl...
We would like to update the Customer Table in
Northwind
database with DTS (As a testing).

We have created a DTS as follow but it doesn't run
successfully. Is there anything wrong ?

Function Main()
DTSDestination("ContactName") = DTSSource
("ContactName")
DTSDestination("CustomerID") = DTSSource
("CustomerID")
Main = DTSTransformStat_UpdateQuery
End Function


.



.




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.