随笔分类 -  sqlserver

摘要:1.对查询进行优化,应尽量避免全表扫描,首先应考虑在 where 及 order by 涉及的列上建立索引。 2.应尽量避免在 where 子句中对字段进行 null 值判断,否则将导致引擎放弃使用索引而进行全表扫描,如: select id from t where num is null 可以在 阅读全文
posted @ 2022-07-27 10:38 飞鱼上树了 阅读(1132) 评论(0) 推荐(0)
摘要:Exec sp_helpserver --查询数据链路 go EXEC sp_addlinkedserver @server='172.16.180.137',--被访问的服务器别名(习惯上直接使用目标服务器IP,或取个别名如:JOY) @srvproduct='', @provider='SQLO 阅读全文
posted @ 2021-04-23 17:06 飞鱼上树了 阅读(77) 评论(0) 推荐(0)
摘要:USE [accountmanager] GO /****** Object: StoredProcedure [dbo].[PersonInfoAddByXmlProc] Script Date: 2019/5/9/周四 10:47:37 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO -- ===========... 阅读全文
posted @ 2019-05-09 15:52 飞鱼上树了 阅读(525) 评论(0) 推荐(0)
摘要:函数操作 去空格CHAR(32),回车CHAR(13),换行符 CHAR(10)select * from logdb.[dbo].[PageErrLogTbl] A where REPLACE( REPLACE(errLog, CHAR(13) + CHAR(10), ''),CHAR(32), 阅读全文
posted @ 2019-04-10 13:59 飞鱼上树了 阅读(334) 评论(0) 推荐(0)
摘要:1 var telReg = /^[1][3,4,5,6,7,8,9][0-9]{9}$/; //0\d{2,3}-\d{7,8} 2 var telReg1 = /^0\d{2,3}-\d{7,8}$/; //0\d{2,3}-\d{7,8} 3 4 5 --3646 6 USE [operationdb] 7 GO 8 ... 阅读全文
posted @ 2019-02-25 13:59 飞鱼上树了 阅读(225) 评论(0) 推荐(0)
摘要:1 --日期运算 (DATEDIFF ( DAY , tblW.CreatTime , GETDATE() ) <=tblW.Effective 阅读全文
posted @ 2018-08-23 13:41 飞鱼上树了 阅读(93) 评论(0) 推荐(0)

/* 看板娘 */