Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 SSIS and Import/Export (2005)
 stored procedure

Author  Topic 

a.ashabi
Posting Yak Master

117 Posts

Posted - 2008-02-11 : 14:43:34
hi.I have this rocedure to show the products by Alphabetics in each page.

CREATE PROCEDURE spGetProductsByAlpha (
@PRODUCT_ALPHA varchar(50)
)
AS

SELECT DISTINCT a.product_name, a.product_id, a.product_msrp, a.product_stripped, pp.product_price,
b.cat_level2_id, b.cat_level2_name, b.cat_level2_stripped, c.cat_level3_name, c.cat_level3_id, c.cat_level3_stripped
FROM tbl_product a
INNER JOIN tbl_product_price pp ON a.product_id = pp.product_id
INNER JOIN tbl_configurator z ON a.product_id = z.product_id
INNER JOIN tbl_cat_level2 b ON z.cat_level2_id = b.cat_level2_id
INNER JOIN tbl_cat_level3 c ON z.cat_level3_id = c.cat_level3_id
WHERE a.product_active = 1
AND a.product_name LIKE @PRODUCT_ALPHA + '%'
ORDER BY a.product_name
GO


but now I need a procedure to show all the products(A-Z) in one page.I dont know how should I change this procedure.would u help me?
thanks

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2008-02-11 : 15:17:13
All products on one page? What do you mean?
A little more help would be great!



E 12°55'05.25"
N 56°04'39.16"
Go to Top of Page

talleyrand
Starting Member

35 Posts

Posted - 2008-02-13 : 18:01:50
How about taking the lazy route and just passing a parameter of % to the stored procedure?

EXECUTE spGetProductsByAlpha '%'

That would give you all active products with a name that starts with anything and ends with anything.
Go to Top of Page
   

- Advertisement -