--我写了个简单的存储过程、但执行出来是个死循环、一直在查询
--我明明有关闭游标和摧毁它
ALTER PROCEDURE [dbo].[GetClsTypeId]
AS
begin
declare @Tree varchar(500)
--创建游标
declare TypeId_cursor cursor for select [Tree] from [3d_Customer_Cymb] where Mark=0 and ParentId=0 and FangXinId=1
open TypeId_cursor
fetch next from TypeId_cursor into @Tree
while @@fetch_status=0
begin
select * from [3d_Customer_Cymb] where Tree LIKE '%'+@Tree+'%' and ParentId <>0
end
close TypeId_cursor
deallocate Type_cursor
end