将此mssql查询转换为mysql

时间:2014-03-11 11:08:18

标签: mysql

CREATE PROC spInsertEmployee
    @EmployeeName nvarchar(50),
    @UserName nvarchar(100),
    @PassWord varchar(100),
    @EmployeeRole nvarchar(100),
    @WorkExperience int,
    @Address nvarchar(100),
    @Email nvarchar(50),
    @Birthday datetime,
    @Gender nvarchar(20),
    @Allowance float,
    @LocationID int,
    @DepartmentID int,
    @ProjectID int
AS
INSERT INTO 
Employee(EmployeeName,UserName,PassWord,EmployeeRole,WorkExperience,Address,Email,Birthday,Gender,Allowance,LocationID,DepartmentID,ProjectID)
VALUES(@EmployeeName,@UserName,@PassWord,@EmployeeRole,@WorkExperience,@Address,@Email,@Birthday,@Gender,@Allowance,@LocationID,@DepartmentID,@ProjectID)

2 个答案:

答案 0 :(得分:0)

类似的东西

 CREATE PROCEDURE spInsertEmployee (_EmployeeName nvarchar(50),
        _UserName nvarchar(100),
        _PassWord varchar(100),
        _EmployeeRole nvarchar(100),
        _WorkExperience int,
        _Address nvarchar(100),
        _Email nvarchar(50),
        _Birthday datetime,
        _Gender nvarchar(20),
        _Allowance float,
        _LocationID int,
        _DepartmentID int,
        _ProjectID int)
     BEGIN
         INSERT INTO 
    Employee(EmployeeName,UserName,PassWord,EmployeeRole,WorkExperience,Address,Email
    ,Birthday,Gender,Allowance,LocationID,DepartmentID,ProjectID)
    VALUES(_EmployeeName,_UserName,_PassWord,_EmployeeRole,_WorkExperience,_Address,_Email
    ,_Birthday,_Gender,_Allowance,_LocationID,_DepartmentID,_ProjectID);
     END

答案 1 :(得分:0)

这样的事情:

CREATE PROCEDURE spInsertEmployee(
    Employee_Name varchar(50),
    User_Name varchar(100),
    User_PassWord varchar(100),
    Employee_Role varchar(100),
    Work_Experience int,
    User_Address varchar(100),
    User_Email varchar(50),
    User_Birthday datetime,
    User_Gender varchar(20),
    User_Allowance float,
    Location_ID int,
    Department_ID int,
    Project_ID int)
AS
BEGIN
  INSERT INTO Employee
  (
      EmployeeName,    UserName,  PassWord,   EmployeeRole,
      WorkExperience,  Address,   Email,      Birthday,
      Gender,          Allowance, LocationID, DepartmentID,
      ProjectID
  )
  VALUES
  (
      Employee_Name,   User_Name,      User_Password, Employee_Role,
      Work_Experience, User_Address,   User_Email,    User_Birthday,
      User_Gender,     User_Allowance, Location_ID,   Department_ID,
      Project_ID
  );
END;

希望它有所帮助! : - )