Click here to Skip to main content
15,908,175 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hiii all
i have astored that will apply the insertion function according to the incoming paramerter.
Example : if paramerter = user insert in the table of user and
if parameter = teacher insert in the table of teacher.

how can i make it , please?
any help

thanks
Posted

1 solution

SQL
CREATE PROCEDURE PerformAction
@ActionType nvarchar(10),
@Name nvarchar(100)
AS
BEGIN
    IF @ActionType = 'User'
        INSERT INTO UsersTable VALUES (@Name)
    ELSE IF @ActionType = 'Teacher'
        INSERT INTO TeachersTable VALUES (@Name)
END
 
Share this answer
 
Comments
moon2011 21-Feb-11 13:14pm    
thanks alot, it is working now
Manas Bhardwaj 22-Feb-11 4:53am    
glad it helped :)

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