SET
ANSI_NULLS
ON
GO
SET
QUOTED_IDENTIFIER
ON
GO
--
=============================================
--
Author: <Author,,Name>
--
Create date: <Create Date,,>
--
Description: <Description,,>
--
=============================================
alter
PROCEDURE
[
dbo
]
.PROG_Order_Main_GetNextPre
@OrderID
nvarchar
(
30
),
@type
int
AS
BEGIN
declare
@result
table
(
id
int
identity
(
1
,
1
),
OrderID
nvarchar
(
30
)
not
null
)
declare
@select
nvarchar
(
400
),
@id
int
insert
into
@result
select
OrderID
from
dbo.Order_Main
order
by
AddTime
desc
--
1上一条
--
2下一条
select
@id
=
id
from
@result
where
OrderID
=
@OrderID
if
(
@type
=
1
)
set
@id
=
@id
-
1
else
set
@id
=
@id
+
1
select
OrderID,AddTime,OrderType,Price_order
from
Order_Main
where
OrderID
=
(
select
OrderID
from
@result
where
id
=
@id
)
END
GO
本文转自火地晋博客园博客,原文链接:http://www.cnblogs.com/yelaiju/archive/2010/06/14/1758395.html,如需转载请自行联系原作者
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)