sql server - Error Msg 213: Column name or number of supplied values does not match table definition -


I have created a table with a stored procedure and I am trying to insert the data into it, but this error

Message 137, Level 15, State 2, Line 49 - Scalar Variable is required to declare "ampleIID")

Please help Do it!

  Create table human resources. Employees (employee employee four (3) hamper pkemployeeid primary key, first name varchar (20) not tap, last name varchar (20) zero, emp_Address varchar (30) blank, title char (30) barrier ckTitle check ',' Senior executive ',' management trainee ',' event manager ',' senior event manager ')), phone deal (20) 9] [0-9] - [0-9] [0-9] [0 -9] [0-9] - [0-9] [0-9] [0-9] - [0-9] [0- 9] [0-9] '))  

Archived Procedure:

  Create a function Auto_EmpID @ First name varchar (20), @LastName varchar (20), @ address warc Announce the form of Har (30), @Title varchar (30), @ Phone varchar (20) AM @ EmployeeID char (3) if present (Select employee from HumanResource. Where is EmployeeID = 'E101') BEGINEM @EmployeeID = Human Resources from Max (right (employee (2)) Select Employee @EmployeeID = CASE when @EmployeeID & Gt; = 0 and @ employee employee & lt; 9 then 'E0' + convert (four (3 ), @EmporiID + 1) @EmployeeID> = 9 and @EmployeeID <99 Then 'E' + Convert (four (3), EmporiId + 1) EDEED and either set @EmployeeID = 'E101' Human resources In writing. Employee Value (@mpariid, @FirstName, @LastName, @Address, @Title, @phone) Return Exx Auto_Ampid 'Bamidale', 'Ajos',' Lagos', '11 -1111-111-111 'Auto AutoAmpid' Kunley ' , 'Avil', 'Ikeja', '22 -3332-655-897 'Humanity Resources. Insert Employee (@Emporiid, @FirstName, @LastName, @Address, @Title, @phone) Price (@EmporiId = 'E1101', 'Bailey', 'Carles', 'Los Angeles', '23-3445- 434-344 ')  

There are many problems with these 2 rows:

  Include in Human Resources. Employee (@ employee, @firstname, @ last name, @ address, @ title, @ phone) value (@ employee = 'e1101', 'bailie', 'carlas', 'los angeles', '23 -3445-434 -344 ')  Ode>  
  1. You do not need the @ symbol prefix for column names, it should only be used with variables.
  2. There are 6 columns in the column list, but you are only supplying 5 values ​​in the value section Please add 6th value or delete the column where you do not insert Want to
  3. If you want to use the value 'e101', then you can insert it directly. If you want to use the variable @employeeID , just go to that pass under the assignment @employeeID = 'e101' in the value section You can do set @employeeID = 'e101 to specify the value before the I insert statement is incorrect.
  4. @employeeID is declared as char (3) , even before you insert statement If you want to assign the value to 'e101', the value will be shorter in 'e10', therefore, you have to declare it as char (4) at least.

Another thing is that your stored procedure takes 5 input parameters, but you pass only 4 it is calling if you want to pass only a few parameters instead of all , You must specify the default value for each parameter when creating process, such as:

  Make the process Auto_EmpID @FirstName varchar (20) = 'Some tournaments', @LastName varchar (20) = 'Somelestnames', @AddressVarkar (30) = 'some whistle' , @TetalNetwork (30) = 'Aerial', @ Phone Verifier (20) = '111-111-111'  

Comments

Popular posts from this blog

import - Python ImportError: No module named wmi -

Editing Python Class in Shell and SQLAlchemy -

lua - HowTo create a fuel bar -