Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 stored procedure

Author  Topic 

Limuh
Yak Posting Veteran

94 Posts

Posted - 2008-05-08 : 04:45:01
I'm trying to insert into the table data using stored procedure.
this is the scenario. if the teacher is Ana i will get all the students under Ana. and when Liza i will get all the students under liza. this is will insert to the table named List.and this data will get to another table named faculty. how can i implement this? thanks.

Anoop
Starting Member

6 Posts

Posted - 2008-05-08 : 04:48:35
This will help but this is not complete code. You have to write logic of procedure.

CREATE PROCEDURE tmp
AS
INSERT INTO tbl
VALUES(1)
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2008-05-08 : 04:49:09
CREATE PROCEDURE dbo.uspInputList
(
@TeacherID VARCHAR(20)
)
AS

SET NOCOUNT ON

INSERT List
select ...
from ...
where ... = @TeacherID

INSERT Faculty
select ...
from ...
where ... = @TeacherID



E 12°55'05.25"
N 56°04'39.16"
Go to Top of Page

Limuh
Yak Posting Veteran

94 Posts

Posted - 2008-05-08 : 05:01:17
thanks i will try this..and i get you back soon thanks again
Go to Top of Page
   

- Advertisement -