Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: VB.NET

Hi guys
I want to make a store procedure which takes values
from two tables
table 1 is Items with
ItemID
Itemname
Quantity
 
table 2 is Staff with
StaffID
Lastname
Firstname
City
Address
 
I need all the staff to take all the items values
Posted 11-Jan-13 9:18am
jomachi1.5K
Comments
Mika Wendelius at 11-Jan-13 15:21pm
   
So do you want to query from those tables in your procedure and return the data or do you want to send the data as parameters and then insert into the tables inside the procedure????
jomachi at 11-Jan-13 15:22pm
   
I want to send the data as parameters and then insert into the tables inside the procedure
jomachi at 11-Jan-13 15:30pm
   
Thanks I will test it

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

To add into a table using a procedure you could have something like:
CREATE PROCEDURE AddItem 
    @ItemId integer, 
    @Itemname nvarchar(100),
    @Quantity integer
AS 
BEGIN
   INSERT INTO Items (ItemID, ItemName, Quantity)
   VALUES (@ItemID, @ItemName, @Quantity);
END;
For more information about the procedure creation, see CREATE PROCEDURE[^]
  Permalink  

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

  Print Answers RSS
Your Filters
Interested
Ignored
     
0 Sergey Alexandrovich Kryukov 840
1 OriginalGriff 508
2 Abhinav S 278
3 thatraja 225
4 Emre Ataseven 200
0 Sergey Alexandrovich Kryukov 8,142
1 OriginalGriff 4,665
2 Peter Leow 3,774
3 Maciej Los 3,515
4 Er. Puneet Goel 3,107


Advertise | Privacy | Mobile
Web02 | 2.8.140415.2 | Last Updated 11 Jan 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Use
Layout: fixed | fluid