Sometimes some databases are infected with Trojans. if it is an sqlserver database, you can use the following method. However, this method is suitable for friends who know sqlserver, but friends who do not know can also use it, some databases are replaced by online management programs.
Sometimes some databases are infected with Trojans. if it is an sqlserver database, you can use the following method. However, this method is suitable for friends who know sqlserver, but friends who do not know can also use it, some databases are replaced by online management programs.
Some Trojan fields in sqlsever are cleared. now we summarize the article "replacing database Trojan fields in batches with sqlsever", hoping to help those in need.
[Solution]
1. back up data first to prevent data loss when the Trojan Field is deleted;
2. execute the following statement for the field text in the Trojan-mounted table to be smaller than 8000 (many software and methods on the Internet are aimed at text less than 8000, you can refer to this solution)
The code is as follows: for example, the context Trojan field in the news table is
The code is as follows:
Update news set context = replace (context ,'','')
The Trojan field is cleared after execution.
3. However, some fields, such as content fields and other varchar fields greater than 8000 characters, must be executed.
The code is as follows:
The code is as follows:
Update news set context = replace (cast (context as varchar (8000 )),'','')
4. sometimes, when the amount of information is large, it will lead to a false death for the database. we can add intervals for batch execution and execute 10000 records each time.
The code is as follows:
Update news
Set context = replace (cast (context as varchar (8000 )),'','')
Where id> 1 and id <10000
The above Trojan problems are generally SQL databases, which are unique to SQL databases.
In fact, we filter all database connection requests from the source, and solve the Trojan issue from the database entry. This requires the programmer's program logic to be meticulous.
There are many database management programs in asp, such as db007.
In php, many mature systems have their own batch replacement functions, such as dedecms.
How can I delete objects as quickly as possible?
"