Re: SQL import dup checking?
From: Dennis Burgess (dmburgess_at_surdyke.remvove.com)
Date: 11/04/04
- Next message: Adam Machanic: "Re: RaiseError with @@ERROR as first parameter"
- Previous message: David Portas: "Re: User Defined Function Help"
- In reply to: David Portas: "Re: SQL import dup checking?"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 4 Nov 2004 08:54:21 -0600
Thank you very much. It does work just like I wished!
Dennis
"David Portas" <REMOVE_BEFORE_REPLYING_dportas@acm.org> wrote in message
news:2o-dnWawGZCAFxTcRVn-rA@giganews.com...
> Possibly this is what you want:
>
> INSERT INTO Table2 (phone_no, date_col, ...)
> SELECT phone_no, CURRENT_TIMESTAMP, ...
> FROM Table1
> WHERE NOT EXISTS
> (SELECT *
> FROM Table2
> WHERE phone_no = Table1.phone_no
> AND date_col >= DATEADD(DAY,-30,CURRENT_TIMESTAMP))
>
> (untested)
>
> --
> David Portas
> SQL Server MVP
> --
>
>
- Next message: Adam Machanic: "Re: RaiseError with @@ERROR as first parameter"
- Previous message: David Portas: "Re: User Defined Function Help"
- In reply to: David Portas: "Re: SQL import dup checking?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|