插入数据
CREATE PROCEDURE Pr_CompanyPubNewPosition
(
@Company_ID int,
@Company_Name_Sql_Search nvarchar(300),
@Company_Name_LinkUrl nvarchar(300),
@Pub_Position_Category nvarchar(50),
@Pub_Position_Function nvarchar(50),
@Pub_Position_SubFunction nvarchar(50),
@Sql_Pub_Function_SubFunction nvarchar(100),
@Pub_Position_Industry nvarchar(50),
@Pub_Position_SelfMade_Position nvarchar(100),
@Pub_Position_Name nvarchar(50),
@Pub_Position_Work_Area_Province nvarchar(50),
@Pub_Position_Number nvarchar(10),
@Pub_Position_MinAge nvarchar(50),
@Pub_Position_MaxAge nvarchar(50),
@Pub_Position_Sex nvarchar(50),
@Pub_Position_ValidDate nvarchar(100),
@Pub_Position_Language nvarchar(50),
@Pub_Position_Academic nvarchar(50),
@Pub_Position_Work_Experience nvarchar(50),
@Pub_Position_Work_Area nvarchar(50),
@Pub_Position_Work_Area_Text nvarchar(50),
@Pub_Position_Sql_Search_Work_Area nvarchar(200),
@Pub_Position_Contact nvarchar(100),
@Pub_Position_Tel_Region nvarchar(50),
@Pub_Position_Tel nvarchar(50),
@Pub_Position_Email nvarchar(50),
@Pub_Position_Fax nvarchar(100),
@Pub_Position_Salary nvarchar(50),
@Pub_Position_Address nvarchar(100),
@Pub_Position_Post nvarchar(50),
@Pub_Position_Details nvarchar(4000),
@UpdateSuccess INT OUTPUT
)
AS
INSERT INTO Company_Pub_Position
(
Company_ID,
Company_Name_Sql_Search,
Company_Name_LinkUrl,
Pub_Position_Category,
Pub_Position_Function,
Pub_Position_SubFunction,
Sql_Pub_Function_SubFunction,
Pub_Position_Industry,
Pub_Position_SelfMade_Position,
Pub_Position_Name,
Pub_Position_Work_Area_Province,
Pub_Position_Number ,
Pub_Position_MinAge,
Pub_Position_MaxAge,
Pub_Position_Sex,
Pub_Position_ValidDate,
Pub_Position_Language,
Pub_Position_Academic,
Pub_Position_Work_Experience,
Pub_Position_Work_Area,
Pub_Position_Work_Area_Text,
Pub_Position_Sql_Search_Work_Area,
Pub_Position_Contact,
Pub_Position_Tel_Region,
Pub_Position_Tel,
Pub_Position_Email,
Pub_Position_Fax,
Pub_Position_Salary,
Pub_Position_Address,
Pub_Position_Post,
Pub_Position_Details
)
VALUES
(
@Company_ID,
@Company_Name_Sql_Search,
@Company_Name_LinkUrl,
@Pub_Position_Category,
@Pub_Position_Function,
@Pub_Position_SubFunction,
@Sql_Pub_Function_SubFunction,
@Pub_Position_Industry,
@Pub_Position_SelfMade_Position,
@Pub_Position_Name,
@Pub_Position_Work_Area_Province,
@Pub_Position_Number ,
@Pub_Position_MinAge,
@Pub_Position_MaxAge,
@Pub_Position_Sex,
@Pub_Position_ValidDate,
@Pub_Position_Language,
@Pub_Position_Academic,
@Pub_Position_Work_Experience,
@Pub_Position_Work_Area,
@Pub_Position_Work_Area_Text,
@Pub_Position_Sql_Search_Work_Area,
@Pub_Position_Contact,
@Pub_Position_Tel_Region,
@Pub_Position_Tel,
@Pub_Position_Email,
@Pub_Position_Fax,
@Pub_Position_Salary,
@Pub_Position_Address,
@Pub_Position_Post,
@Pub_Position_Details
)
IF @@ERROR = 0
SET @UpdateSuccess = 1
ELSE
SET @UpdateSuccess = -1
GO
(
@Company_ID int,
@Company_Name_Sql_Search nvarchar(300),
@Company_Name_LinkUrl nvarchar(300),
@Pub_Position_Category nvarchar(50),
@Pub_Position_Function nvarchar(50),
@Pub_Position_SubFunction nvarchar(50),
@Sql_Pub_Function_SubFunction nvarchar(100),
@Pub_Position_Industry nvarchar(50),
@Pub_Position_SelfMade_Position nvarchar(100),
@Pub_Position_Name nvarchar(50),
@Pub_Position_Work_Area_Province nvarchar(50),
@Pub_Position_Number nvarchar(10),
@Pub_Position_MinAge nvarchar(50),
@Pub_Position_MaxAge nvarchar(50),
@Pub_Position_Sex nvarchar(50),
@Pub_Position_ValidDate nvarchar(100),
@Pub_Position_Language nvarchar(50),
@Pub_Position_Academic nvarchar(50),
@Pub_Position_Work_Experience nvarchar(50),
@Pub_Position_Work_Area nvarchar(50),
@Pub_Position_Work_Area_Text nvarchar(50),
@Pub_Position_Sql_Search_Work_Area nvarchar(200),
@Pub_Position_Contact nvarchar(100),
@Pub_Position_Tel_Region nvarchar(50),
@Pub_Position_Tel nvarchar(50),
@Pub_Position_Email nvarchar(50),
@Pub_Position_Fax nvarchar(100),
@Pub_Position_Salary nvarchar(50),
@Pub_Position_Address nvarchar(100),
@Pub_Position_Post nvarchar(50),
@Pub_Position_Details nvarchar(4000),
@UpdateSuccess INT OUTPUT
)
AS
INSERT INTO Company_Pub_Position
(
Company_ID,
Company_Name_Sql_Search,
Company_Name_LinkUrl,
Pub_Position_Category,
Pub_Position_Function,
Pub_Position_SubFunction,
Sql_Pub_Function_SubFunction,
Pub_Position_Industry,
Pub_Position_SelfMade_Position,
Pub_Position_Name,
Pub_Position_Work_Area_Province,
Pub_Position_Number ,
Pub_Position_MinAge,
Pub_Position_MaxAge,
Pub_Position_Sex,
Pub_Position_ValidDate,
Pub_Position_Language,
Pub_Position_Academic,
Pub_Position_Work_Experience,
Pub_Position_Work_Area,
Pub_Position_Work_Area_Text,
Pub_Position_Sql_Search_Work_Area,
Pub_Position_Contact,
Pub_Position_Tel_Region,
Pub_Position_Tel,
Pub_Position_Email,
Pub_Position_Fax,
Pub_Position_Salary,
Pub_Position_Address,
Pub_Position_Post,
Pub_Position_Details
)
VALUES
(
@Company_ID,
@Company_Name_Sql_Search,
@Company_Name_LinkUrl,
@Pub_Position_Category,
@Pub_Position_Function,
@Pub_Position_SubFunction,
@Sql_Pub_Function_SubFunction,
@Pub_Position_Industry,
@Pub_Position_SelfMade_Position,
@Pub_Position_Name,
@Pub_Position_Work_Area_Province,
@Pub_Position_Number ,
@Pub_Position_MinAge,
@Pub_Position_MaxAge,
@Pub_Position_Sex,
@Pub_Position_ValidDate,
@Pub_Position_Language,
@Pub_Position_Academic,
@Pub_Position_Work_Experience,
@Pub_Position_Work_Area,
@Pub_Position_Work_Area_Text,
@Pub_Position_Sql_Search_Work_Area,
@Pub_Position_Contact,
@Pub_Position_Tel_Region,
@Pub_Position_Tel,
@Pub_Position_Email,
@Pub_Position_Fax,
@Pub_Position_Salary,
@Pub_Position_Address,
@Pub_Position_Post,
@Pub_Position_Details
)
IF @@ERROR = 0
SET @UpdateSuccess = 1
ELSE
SET @UpdateSuccess = -1
GO
格式化
SELECT
Rc_Ureg_Date = replace(convert(varchar(10),A.Rc_Ureg_Date,102),'.','-'),
Rc_Major_ShowText=(case when A.Rc_Major_SelfDefine = '' then Rc_Major_Text else rtrim(A.Rc_Major_SelfDefine) end),
year(getdate())-Rc_Birth_Year as Rc_Age_Text,
H.Sex_Name,
Pub_Position_Date = replace(convert(varchar(10),B.Pub_Position_Date,102),'.','-'),
AgeRange=cast(B.Pub_Position_MinAge as varchar)+'-'+cast(B.Pub_Position_MaxAge as varchar),
valid_date =convert( varchar(10), dateadd( month,B.Pub_Position_ValidDate,B.Pub_Position_Date),120),
Person_Number=(case B.Pub_Position_Number when 0 then '若干' else rtrim(B.Pub_Position_Number) end),
CASE WHEN B.Pub_Position_Work_Area='' OR B.Pub_Position_Work_Area ='0000' THEN '' ELSE E.Area_Name END AS CityResult
H.Sex_Name,
Pub_Position_Date = replace(convert(varchar(10),B.Pub_Position_Date,102),'.','-'),
AgeRange=cast(B.Pub_Position_MinAge as varchar)+'-'+cast(B.Pub_Position_MaxAge as varchar),
valid_date =convert( varchar(10), dateadd( month,B.Pub_Position_ValidDate,B.Pub_Position_Date),120),
Person_Number=(case B.Pub_Position_Number when 0 then '若干' else rtrim(B.Pub_Position_Number) end),
CASE WHEN B.Pub_Position_Work_Area='' OR B.Pub_Position_Work_Area ='0000' THEN '' ELSE E.Area_Name END AS CityResult