Sqlserver替换函数Replace

Sqlserver中Replace函数:实现字段中某个字符串批量替换。 注意:强烈建议替换前备份数据库以免发生灾难性后果。 update article set [Content]=replace([content],’$’,”); 在使用replace函数时,第一个参数一定不要加引号!!!

Nginx 配置

#user nobody; worker_processes 4; error_log logs/error.log; #error_log logs/error.log notice; #error_log logs/error.log info; #pid logs/nginx.pid; worker_rlimit_nofile 65535; events { use epoll; worker_connections 10024; } http { #include /usr/local/nginx/conf/proxy.conf; #include /usr/local/nginx/conf/vhosts/www.test.com.conf; include mime.types; default_type application/octet-stream; #log_format main ‘$remote_addr – $remote_user [$time_local] “$request” ‘ # ‘$status $body_bytes_sent “$http_referer” ‘ # ‘”$http_user_agent” “$http_x_forwarded_for”‘; #access_log logs/access.log main; sendfile on; #tcp_nopush … Read more

查询表锁,解锁

–查询表锁,解锁 select request_session_id spid,OBJECT_NAME(resource_associated_entity_id) tableName from sys.dm_tran_locks where resource_type=’OBJECT’ declare @spid int Set @spid = 99 –锁表进程 declare @sql varchar(1000) set @sql=’kill ‘+cast(@spid as varchar) exec(@sql)

SQL Server数据库日志分离

有时候我们经常会遇见,数据库日志因为过大,而占据着磁盘大量空间。所以当磁盘空间不足的时候我们要定期清理一下过大的一些日志文件。 1.清理之前先分离日志: 菜单:任务>分离,弹出的界面,确认!2.删除数据库的日志,找到你存储数据库日志的地方,删除它(ldf文件,别删错,不放心的先备份)。3.附加数据库,因为数据日志已经不存在,附加的时候,删除日志路径。 注:(在做数据分离的时候最好先创建一个库先测试一下,避免误操作导致无法恢复)