Sqlserver替换函数Replace
Sqlserver中Replace函数:实现字段中某个字符串批量替换。 注意:强烈建议替换前备份数据库以免发生灾难性后果。 update article set [Content]=replace([content],’$’,”); 在使用replace函数时,第一个参数一定不要加引号!!!
End of the universe is coding.
Sqlserver中Replace函数:实现字段中某个字符串批量替换。 注意:强烈建议替换前备份数据库以免发生灾难性后果。 update article set [Content]=replace([content],’$’,”); 在使用replace函数时,第一个参数一定不要加引号!!!
#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)
有时候我们经常会遇见,数据库日志因为过大,而占据着磁盘大量空间。所以当磁盘空间不足的时候我们要定期清理一下过大的一些日志文件。 1.清理之前先分离日志: 菜单:任务>分离,弹出的界面,确认!2.删除数据库的日志,找到你存储数据库日志的地方,删除它(ldf文件,别删错,不放心的先备份)。3.附加数据库,因为数据日志已经不存在,附加的时候,删除日志路径。 注:(在做数据分离的时候最好先创建一个库先测试一下,避免误操作导致无法恢复)
–将列名输出为一行,用逗号分隔select STUFF((select ‘,’+a.namefrom syscolumns A Inner Join sysobjects D on A.id=D.idand d.name=’tableName’ order by a.colorder for xml path(”)),1,1,”)
判断workcode列不是数字,udpate 为空update tableName set workcode = null where workcode like ‘%[^0-9]%’
还原数据库时,提示还原成功,可是数据库列表中该数据库显示正在还原中: 执行此命令即可: RESTORE DATABASE EnterPriseBuilding WITH RECOVERY
sql server 数据库服务器C盘增长过快 路径 C:\Windows\Logs\CBS 建议备份后删除,或者移动到其它磁盘
SELECT max(Id)/*注意Id必须使用聚合函数Max*/ , Pid, MAX(Time) as MaxTime FROM Test GROUP BY pid