摘要: WITH testtb2 AS ( select b.ActionID,a.VisitorCard,b.FStatus,CHARINDEX(',', A.VisitorCard) AS STA, CHARINDEX(',', A.VisitorCard) - 1 AS LENS From Secur 阅读全文
posted @ 2019-05-06 15:31 望着天的蜗牛 阅读(604) 评论(0) 推荐(0)
摘要: select b.* from (select a.*,row_number() over (partition by 列1 order by 列2 desc) rn from a) b where rn=1; --如需联表 select e.Customer,a.SAPModel,a.PackNo 阅读全文
posted @ 2019-05-06 15:30 望着天的蜗牛 阅读(1650) 评论(0) 推荐(0)
摘要: --方法1WITH CTE_SID ( BSID, SID, sql_handle ) AS ( SELECT blocking_session_id , session_id , sql_handle FROM sys.dm_exec_requests WHERE blocking_session 阅读全文
posted @ 2019-05-06 15:29 望着天的蜗牛 阅读(1987) 评论(0) 推荐(0)
摘要: 当使用:SELECT ','+Id FROM dbo.Test FOR XML PATH('')); //这样读取的数据虽然是1,2,3,4,但是仍然是xml格式,所以当数据超过2033时候,用sqldatereader或者sqldateadapter读取数据会截断xml文件。 此时要:SELECT 阅读全文
posted @ 2019-05-06 15:28 望着天的蜗牛 阅读(1804) 评论(0) 推荐(0)
摘要: 游标更新删除当前数据 1.声明游标 declare orderNum_03_cursor cursor scroll for select OrderId ,userId from bigorder where orderNum='ZEORD003402' --2.打开游标 open orderNu 阅读全文
posted @ 2019-05-06 15:26 望着天的蜗牛 阅读(728) 评论(0) 推荐(0)
摘要: select row_number() over(order by a.column_id) rownumber, a.name, case when t.name in (N'decimal', N'numeric') then t.name + '('+ Convert(varchar(10), 阅读全文
posted @ 2019-05-06 15:24 望着天的蜗牛 阅读(574) 评论(0) 推荐(0)
摘要: 添加服务 @echo.服务启动...... @echo off @sc create 服务名 binPath= "%~dp0\服务路径" @sc config 服务名 start= AUTO @sc config 服务名 displayname= "服务显示的名字" @sc config 服务名 d 阅读全文
posted @ 2019-05-06 15:03 望着天的蜗牛 阅读(616) 评论(0) 推荐(0)