[dbo].[CollectionNext]
(local)
>
mdb
>
Scalar-valued Functions
> dbo.CollectionNext
Properties
Parameters
SQL Script
Uses
Properties
Property
Value
ANSI Nulls On
Quoted Identifier On
Parameters
Name
Data Type
Max Length (Bytes)
@x
xml
max
@i
int
4
SQL Script
CREATE
FUNCTION
[dbo]
.
[CollectionNext]
(
@x
XML
,
@i
int
)
returns
int
BEGIN
return
(
select
min
(
val
)
from
(
select
T.c.value
(
'@key'
,
'int'
)
val
FROM
@x.nodes
(
'collection/item'
)
T
(
c
))
a
WHERE
val
>
@i
)
END
;
GO
Uses
dbo
[T].[c].[value]