J
Java
You can use Find method.
Javed.
Javed.
William (Bill) Vaughn said:INSERT INTO [biblio].[dbo].[Authors]([Au_ID], [Author], [Year_Born])
VALUES(@Au_ID, @Author, @Year_Born)
WHERE (NOT EXISTS (SELECT AU_ID FROM Authors WHERE AU_ID = @AU_ID)
hth
--
____________________________________
Bill Vaughn
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
ItsMe said:William,
Can you please give me a simple example. ?
regards
so
i'll not.
If
William (Bill) Vaughn said:INSERT INTO [biblio].[dbo].[Authors]([Au_ID], [Author], [Year_Born])
VALUES(@Au_ID, @Author, @Year_Born)
WHERE (NOT EXISTS (SELECT AU_ID FROM Authors WHERE AU_ID = @AU_ID)
hth
--
____________________________________
Bill Vaughn
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
ItsMe said:William,
Can you please give me a simple example. ?
regards
so
i'll not.
If
Norman Yuan said:I didn't know that you can follow a "INSERT INTO...VALUES..." with a
"WHERE..." clause, at least it is not mentioned in all books that I have.
INSERT,William (Bill) Vaughn said:INSERT INTO [biblio].[dbo].[Authors]([Au_ID], [Author], [Year_Born])
VALUES(@Au_ID, @Author, @Year_Born)
WHERE (NOT EXISTS (SELECT AU_ID FROM Authors WHERE AU_ID = @AU_ID)
hth
--
____________________________________
Bill Vaughn
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
ItsMe said:William,
Can you please give me a simple example. ?
regards
I would not take this approach. I suggest creating an INSERT query that
contains the needed new row values as parameters and include a WHERE
clause
that inserts the row if it does not already exist (WHERE NOT EXISTS) based
on the primary key. That's because even if you query to see if a row is
there or not, by the time you turn around and actually do therecipientit for
theof may
not