J
Java
You can use Find method.
Javed.
Javed.
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
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
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.