Click here to Skip to main content
16,012,468 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
C#
how to insert in DrugID and DrugName in Drugs table and DrugID and DrugName in stock table by one proceduer


What I have tried:

how to insert in DrugID and DrugName in Drugs table and DrugID and DrugName in stock table by one proceduer
Posted
Updated 7-Mar-16 6:32am

1 solution

That's pretty easy stuff to do. If you know the very basics of stored procedure then you should be able to do this. Also note that "What I have tried" is for showing what you have tried so far so that we can suggest a quick solution.

You may need something like following-

SQL
CREATE PROC SaveDrug
(
  @DrugId INT,
  @DrugName VARCHAR(50)
)
AS
BEGIN
  INSERT INTO Drugs
  (DrugId, DrugName)
  VALUES(@DrugId, @DrugName)

  INSERT INTO Stock
  (DrugId, DrugName)
  VALUES(@DrugId, @DrugName)
END


Hope, it helps :)
 
Share this answer
 
Comments
NebroProg 22-Mar-16 9:06am    
Than you my dear ^_^
Suvendu Shekhar Giri 22-Mar-16 22:41pm    
welcome :)
If my answer helped, please mark it as answer so that others can take reference too.
Thanks
NebroProg 15-May-16 1:30am    
Thanks :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900