(Transfer) implementation of the account that has not been logged in for three months, automatically deletes it from the databas

xiaoxiao2021-03-06  63

1. You have a login date in your table, automatically update this login date each time you log in.

2. Write a job, perform the work of cleaning up the expiration account per day (whether you have your own yourself) - Clean the statement from the expetive version delete from table Where login date

- Working method:

Enterprise Manager - Administration - SQL Server Agent - Right-click Job - Enter Job Name in "General" - "Step" - New - New - "Step Name" Enter the step name - "Type" Select "Transact-SQL Script (TSQL)" - "Database" Select the Database of the Execute Command - "Command" Enter the statement you want to perform: Delete from table Where login date

Then start the SQL Agent service and set to automatically start, otherwise your job will not be executed.

Setting method: My Computer - Control Panel - Administrative Tools - Services - Right-Right-Right-Right-Right-Right-Start Type-Select Auto Start-OK.

转载请注明原文地址:https://www.9cbs.com/read-89839.html

New Post(0)