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
0 Sergey Alexandrovich Kryukov 405
1 CPallini 375
2 BillWoodruff 314
3 George Jonsson 279
4 OriginalGriff 227
0 OriginalGriff 5,030
1 CPallini 4,225
2 Sergey Alexandrovich Kryukov 3,604
3 George Jonsson 2,831
4 Gihan Liyanage 2,386


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

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100