我有一张桌子,里面有 50 列。从我后面的代码开始,我使用存储过程插入 10 个值,然后在基于用户 ID 的第二页中,我想更新其他 40 列。所以我正在更新表,并且表的 userid 列是一个自动递增的标识列,那么如何获取更新存储过程的用户 id?
CREATE PROCEDURE sp_update
(@FormFiledBy varchar(50), @MaritalStatus varchar(50),
@Height varchar(50), @Religion varchar(50), @Caste varchar(100),
@MotherTongue varchar(50), @Education varchar(100),
@Occupation varchar(50), @CountryofResidence varchar(50),
@EducationDetails varchar(100), @AnnualIncome varchar(50),
@CountryOfBirth varchar(50), @BirthPlace varchar(50),
@TimeOfBirth nchar(10), @StarSign varchar(100),
@Gothram varchar(50), @Rassi varchar(50), @HavinChildren varchar(10),
@PhysicalStatus varchar (100)
)
AS
BEGIN
UPDATE Profile_Master
SET FormFiledBy = @FormFiledBy,
MaritalStatus = @MaritalStatus,
Height = @Height,
physicalStatus = @physicalStatus,
Religion = @Religion,
Caste = @Caste,
MotherTongue = @MotherTongue,
Education = @Education,
Occupation = @Occupation,
CountryofResidence = @CountryofResidence,
EducationDetails = @EducationDetails,
AnnualIncome = @AnnualIncome,
CountryOfBirth = @CountryOfBirth,
BirthPlace = @BirthPlace,
TimeOfBirth = @TimeOfBirth,
StarSign = @StarSign,
Gothram = @Gothram,
Rassi = @Rassi,
HavinChildren = @HavinChildren,
PhysicalStatus = @PhysicalStatus
WHERE
????
END