SQL Queries for Creating a rollback point and to rollback to that specific point
- by Santhosha
Hi,
As per my project requirement i want to perform two operation
Password Change
Unlock Account(Only unlocking account, no password change!)
I want return success only if both the transactions succeeds. Say if password change succeeds and unlock fails i cannot send success or failure. So i want to create a rollback point before password change, if both queries executes successfully i will commit the transaction. If one of the query fails i will discard the changes by rolling back to the rollback point. I am doing this in C++ using ADO. Is there any SQL Queries,using i can create the rollback point and reverting to rollback point and commiting the transaction
I am using below commands for
Password change
ALTER LOGIN [username] WITH PASSWORD = N'password'
for Unlock account
ALTER LOGIN [%s] WITH CHECK_POLICY = OFF
ALTER LOGIN [%s] WITH CHECK_POLICY = ON
Thanks in advance!!
Santhosh