i would like to insert custom values along with table columns when i perform INSERT INTO ...SELECT FROM ... WHERE
clause
INSERT INTO RoleMappingEmployee_Delete_History (
RoleMappingEmployeeKey,
SrKey,
RoleKey,
SubmittedDate,
SubmittedBy,
IsActive,
DeletedBy,
DeletedDateTime)
SELECT
RoleMappingEmployeeKey,
SrKey,
RoleKey,
SubmittedDate,
SubmittedBy,
IsActive,
DeletedBy,
DeletedDateTime
FROM
RoleMappingEmployee
WHERE
RoleMappingEmployeeKey IN (25902,38188,25887)
i would like to insert values for DeletedBy,DeletedDateTime
with custom values
INSERT INTO RoleMappingEmployee_Delete_History (
RoleMappingEmployeeKey,
SrKey,
RoleKey,
SubmittedDate,
SubmittedBy,
IsActive,
DeletedBy,
DeletedDateTime)
SELECT
RoleMappingEmployeeKey,
SrKey,
RoleKey,
SubmittedDate,
SubmittedBy,
IsActive,
'peter',
getdate()
FROM
RoleMappingEmployee
WHERE
RoleMappingEmployeeKey IN (25902,38188,25887)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With