随笔分类 -  SQLServer

SQLServer语法与使用的技巧
摘要:exec sp_addlinkedserver 'test ', ' ','SQLOLEDB','58.214.34.132,9046' exec sp_addlinkedsrvlogin 'test','false',null,'sa','wxsy1234' select count(1) fro 阅读全文
posted @ 2016-11-08 16:07 Alfred.Xu 阅读(291) 评论(0) 推荐(0) 编辑
摘要:拼字符串成为时间,和两个计算时间点的中间值 select convert(datetime,'2016-09-18 '+SUBSTRING(CONVERT(varchar(100),d_bdate, 24), 0, 9),21) from B2C_daima where d_no='B04' sel 阅读全文
posted @ 2016-09-19 18:30 Alfred.Xu 阅读(665) 评论(0) 推荐(0) 编辑
摘要:select top 10 * from schedule_month where years=2016 and months=7 and managerid=45SELECT top 10 cast(years AS varchar) + '-' + RIGHT('0' + CAST(months 阅读全文
posted @ 2016-08-17 11:04 Alfred.Xu 阅读(220) 评论(0) 推荐(0) 编辑
摘要:with cte as ( select id,parent_id from [dbo].[manager_Department] where id=42 union all select b.id,b.parent_id from cte a join [dbo].[manager_Departm 阅读全文
posted @ 2016-05-26 19:59 Alfred.Xu 阅读(135) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示