随笔分类 -  【006】SQLSERVER

摘要:CREATE PROCEDURE [dbo].[usp_UserFriendsOrder] @s varchar(MAX) as --如果临时表存在则先删除 if exists(select * from dbo.sysobjects where object_id('tempdb.dbo.#temp') is not null) delete from #temp else c... 阅读全文
posted @ 2016-05-18 15:25 编程老男孩 阅读(5088) 评论(0) 推荐(0)
摘要:最近项目中要递归树形,案例如下: 测试数据: CREATE TABLE tb(ID char(3),PID char(3),Name nvarchar(10)) INSERT tb SELECT'001',NULL ,'山东省' UNION ALL SELECT'002','001','烟台市' U 阅读全文
posted @ 2016-02-25 10:24 编程老男孩 阅读(2094) 评论(0) 推荐(0)