doctor2001
IS-IT--Management
Hi -
If anybody could help me with this stored procedure it would be greatly appreciated…
ALTER PROCEDURE dbo.GetMy_show_Images_ImageID_GetInfo
@galleryid int,
@imageId int
AS
SELECT myZoom, imageName
FROM My_show_Images
WHERE [imageid] = @imageId
SELECT top 1 imageId as nextId
FROM My_show_Images
WHERE
[galleryid] = @galleryId
AND
[imageid] > @imageId
ORDER by imageId
SELECT top 1 imageId as prevId
FROM My_show_Images
WHERE
[galleryid] = @galleryId
AND
[imageid] < @imageId
ORDER by imageId DESC
I would like to have the results returned to one row instead of 3…Is this possible?
Thanks In Advance
If anybody could help me with this stored procedure it would be greatly appreciated…
ALTER PROCEDURE dbo.GetMy_show_Images_ImageID_GetInfo
@galleryid int,
@imageId int
AS
SELECT myZoom, imageName
FROM My_show_Images
WHERE [imageid] = @imageId
SELECT top 1 imageId as nextId
FROM My_show_Images
WHERE
[galleryid] = @galleryId
AND
[imageid] > @imageId
ORDER by imageId
SELECT top 1 imageId as prevId
FROM My_show_Images
WHERE
[galleryid] = @galleryId
AND
[imageid] < @imageId
ORDER by imageId DESC
I would like to have the results returned to one row instead of 3…Is this possible?
Thanks In Advance