Advertisement
Guest User

Untitled

a guest
Sep 30th, 2016
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 KB | None | 0 0
  1. Alter PROCEDURE [dbo].[Update_Customers]
  2. @typeMembership aspnet_Membership_type READONLY
  3. AS
  4. BEGIN
  5. SET NOCOUNT ON;
  6.  
  7. MERGE INTO aspnet_Membership c1
  8. USING @typeMembership c2
  9. ON c1.EmployeeCode=c2.EmployeeCode
  10. WHEN MATCHED THEN
  11. UPDATE SET
  12. c1.[EmployeeCode] = c2.[EmployeeCode] ,
  13. c1.[EmployeeTypeId] = c2.[EmployeeTypeId] ,
  14. c1.[FirstName] = c2.[FirstName] ,
  15. c1.[LastName] = c2.[LastName] ,
  16. c1.[Gender] = c2.[Gender] ,
  17. c1.[Email] = c2.[Email] ,
  18. c1.[MobilePIN] = c2.[MobilePIN] ,
  19. c1.[Current_Address] = c2.[Current_Address] ,
  20. c1.[Permanent_Address] = c2.[Permanent_Address] ,
  21. c1.[IsApproved] = c2.[IsApproved]
  22. WHEN NOT MATCHED THEN
  23. INSERT VALUES (c2.EmployeeCode, c2.EmployeeTypeId,c2.FirstName,c2.LastName,c2.Gender,c2.Email,c2.MobilePIN,c2.Current_Address, c2.Permanent_Address,c2.IsApproved);
  24. END
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement