
ProTech-Online.com
Microsoft SQL code example for get users shopping carts.
USE [sans]
GO
/****** Object: StoredProcedure [dbo].[get_carts] Script Date: 10/19/2011 11:07:50 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
--
=============================================
-- Author: <Author,,Name>
-- Create date: <Create Date,,>
-- Description: <Description,,>
--
=============================================
CREATE PROCEDURE [dbo].[get_carts]
-- Add the parameters for the stored procedure here
@sessionid uniqueidentifier
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
-- Insert statements for procedure here
SELECT t2.name, t2.price FROM [dbo].[carts] as t1, [dbo].[items] as t2
WHERE t1.sessionid = @sessionid and t2.itemid = t1.itemid
END
GO
Copyright © 2013 ProTechs-Online.com; All rights reserved.