Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DTS error DATA pump WRONG POINTER

Status
Not open for further replies.

Ericordina

Technical User
Nov 28, 2006
10
NL
Hello,

I'm trying to create a DTS statement wich must transfer
records from DATABASE1.TABEL1 to DATABASE2.TABELTEMP.

Select Distinct ID
ID2
getdate () as 'DATE'
from TABEL1

where not exists
(select id,id2
from DATABASE2.user.TABELTEMP)

If i execute the DTS i get an error that there is an
wrong Pointer.

If i exetute the statement in the Analyser everything goes well.

Can sombody tell what i do wrong


greetings,

Eric
 
That statement will never execute in query analyzer, because it does not have commas between the column names. I think your where clause is missing some pieces as well.

Code:
Select Distinct [b]a.[/b]ID
[b],[/b]                [b]a.[/b]ID2
[b],[/b]                getdate () as 'DATE'
from TABEL1 a  --need to use alias to reference this in subquery

where not exists
           (select * ---using * in a not exists is faster
            from DATABASE2.dbo.TABELTEMP
	    [b]where id = a.ID
	    and id2 = a.ID[/b])

Here is a different way to do it, without the subquery.

Code:
Select Distinct a.ID
, a.ID2
, getdate() as DATE
from TABEL1 a
left join
DATABASE2.dbo.TABELTEMP b
on a.id = b.id
and a.id2 = b.id2
where b.id is null

NOne of this is tested.

I replaces 'user' with 'dbo' just to see if they parse OK. Are you hoping this query will insert, or is this the source for a data pump task?

Hope it helps,

Alex

Ignorance of certain subjects is a great part of wisdom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top