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

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Save Password
Forgot your Password?

 All Forums
 SQL Server 2005 Forums
 SSIS and Import/Export (2005)
 stored procedure
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Posting Yak Master

117 Posts

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

CREATE PROCEDURE spGetProductsByAlpha (
@PRODUCT_ALPHA varchar(50)

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

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?

Patron Saint of Lost Yaks

30421 Posts

Posted - 02/11/2008 :  15:17:13  Show Profile  Visit SwePeso's Homepage  Reply with Quote
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

Starting Member

35 Posts

Posted - 02/13/2008 :  18:01:50  Show Profile  Visit talleyrand's Homepage  Click to see talleyrand's MSN Messenger address  Send talleyrand a Yahoo! Message  Reply with Quote
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
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.04 seconds. Powered By: Snitz Forums 2000