For your question perhaps you want some sql like
IF EXISTS(select Bname from Books where Bname='NEWBOOKNAME') BEGIN
Update Bookcopies set BooksCopies=BooksCopies + 1 where Bname='NEWBOOKNAME'
END ELSE BEGIN
Insert into Books .....
End
in one SQL.
May be you can write a stored procedure instead. and use parameters to avoid injection.