dbTalk Databases Forums  

Re: How to update data via DTS (ActiveX VB Script)

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


Discuss Re: How to update data via DTS (ActiveX VB Script) in the microsoft.public.sqlserver.dts forum.



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

Default Re: How to update data via DTS (ActiveX VB Script) - 09-01-2003 , 02:48 AM






alter TblDESTINATION field's FIRMCODE to Identity
and do the ff: statement

INSERT INTO TblDESTINATION
SELECT HERSTELLER FROM TblSOURCE
WHERE HERSTELLER NOT IN
(SELECT HERSTELLER
FROM TblDESTINATION)

--
gani




"Michael Papenhagen" <mpa (AT) b-w-computer (DOT) de> wrote

Quote:
Hallo,


I habe a little problem. I have two tables:

Table Source:

HERSTELLER
---------------
Compaq
Dell
IBM

Table Destination:

FIRMCODE HERSTELLER
------------- ----------------
1 Compaq
2 HP


What I want to do is:

Look which HERSTELLER are not present in the source and put it in the
destination table.
The FIRMCODE should have a continuing counter.


So the result should look like:

FIRMCODE HERSTELLER
------------- ----------------
1 Compaq
2 HP
3 DELL
4 IBM


Who can help?
I have no idea how to realize the continiung counter and find out which
entries are not in the destination.

Best regards,

Michael








Reply With Quote
  #2  
Old   
Michael Papenhagen
 
Posts: n/a

Default Re: How to update data via DTS (ActiveX VB Script) - 09-01-2003 , 03:30 AM






O.K. But how can we create the create the FIRMCODE?
To get the highest number from firmcode we have to use select max(FIRMCODE)
from tbldestination....
And then..???


Michael


"gani" <a@a.com> schrieb im Newsbeitrag
news:O9Kj91FcDHA.2436 (AT) TK2MSFTNGP12 (DOT) phx.gbl...
Quote:
alter TblDESTINATION field's FIRMCODE to Identity
and do the ff: statement

INSERT INTO TblDESTINATION
SELECT HERSTELLER FROM TblSOURCE
WHERE HERSTELLER NOT IN
(SELECT HERSTELLER
FROM TblDESTINATION)

--
gani




"Michael Papenhagen" <mpa (AT) b-w-computer (DOT) de> wrote in message
news:3f522018$0$31843$9b622d9e (AT) news (DOT) freenet.de...
Hallo,


I habe a little problem. I have two tables:

Table Source:

HERSTELLER
---------------
Compaq
Dell
IBM

Table Destination:

FIRMCODE HERSTELLER
------------- ----------------
1 Compaq
2 HP


What I want to do is:

Look which HERSTELLER are not present in the source and put it in the
destination table.
The FIRMCODE should have a continuing counter.


So the result should look like:

FIRMCODE HERSTELLER
------------- ----------------
1 Compaq
2 HP
3 DELL
4 IBM


Who can help?
I have no idea how to realize the continiung counter and find out which
entries are not in the destination.

Best regards,

Michael










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

Default Re: How to update data via DTS (ActiveX VB Script) - 09-01-2003 , 09:16 PM



you do not have to do 'select max(FIRMCODE)'
as i have said, set FIRMCODE column identity to YES.

On the Enterprise Manager, right click tblDESTINATION and choose
Design Table. Then, click on FIRMCODE. On Columns Pane, set IDENTITY
to YES. Save the changes and thats it. It will create an automatic
incremental number.


--
gani




"Michael Papenhagen" <MPa (AT) b-w-computer (DOT) de> wrote

Quote:
O.K. But how can we create the create the FIRMCODE?
To get the highest number from firmcode we have to use select
max(FIRMCODE)
from tbldestination....
And then..???


Michael


"gani" <a@a.com> schrieb im Newsbeitrag
news:O9Kj91FcDHA.2436 (AT) TK2MSFTNGP12 (DOT) phx.gbl...
alter TblDESTINATION field's FIRMCODE to Identity
and do the ff: statement

INSERT INTO TblDESTINATION
SELECT HERSTELLER FROM TblSOURCE
WHERE HERSTELLER NOT IN
(SELECT HERSTELLER
FROM TblDESTINATION)

--
gani




"Michael Papenhagen" <mpa (AT) b-w-computer (DOT) de> wrote in message
news:3f522018$0$31843$9b622d9e (AT) news (DOT) freenet.de...
Hallo,


I habe a little problem. I have two tables:

Table Source:

HERSTELLER
---------------
Compaq
Dell
IBM

Table Destination:

FIRMCODE HERSTELLER
------------- ----------------
1 Compaq
2 HP


What I want to do is:

Look which HERSTELLER are not present in the source and put it in the
destination table.
The FIRMCODE should have a continuing counter.


So the result should look like:

FIRMCODE HERSTELLER
------------- ----------------
1 Compaq
2 HP
3 DELL
4 IBM


Who can help?
I have no idea how to realize the continiung counter and find out
which
entries are not in the destination.

Best regards,

Michael












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.