Click here to Skip to main content
15,885,216 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
SQL
create proc [dbo].[InsertUser]
 (@AdvName nvarchar(50),@Addtype int,@Addgov int,@Addreg int,@AddFloor int,
@Addfinish int,@Addsalary int,@Addtel int)
 
 as insert into AdvertiseNames values
 
 (@AdvName,@Addtype,@Addreg,@AddFloor,@Addfinish,@Addsalary,@Addtel)
  insert into Regions values
 (@Addgov)

what's the wrong here plz?????
Posted
Updated 29-Dec-11 8:13am
v2
Comments
Wendelius 29-Dec-11 14:13pm    
Getting an error, if so, what is the error?

1 solution

Without knowing the exact error you get I would guess that the insert statements are failing because you haven't listed the target columns. Try something like:
SQL
create procedure [dbo].[InsertUser]
   (@AdvName nvarchar(50),
    @Addtype int,
    @Addgov int,
    @Addreg int,
    @AddFloor int,
    @Addfinish int,
    @Addsalary int,
    @Addtel int)
as 
begin
   insert into AdvertiseNames 
     (AdvName,Addtype,Addreg,AddFloor,Addfinish,Addsalary,Addtel) 
     values
     (@AdvName,@Addtype,@Addreg,@AddFloor,@Addfinish,@Addsalary,@Addtel);

   insert into Regions 
      (Addgov)
      values
      (@Addgov);
end;

The column names are pure guesses since I don't know your table structure.
 
Share this answer
 

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