This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
ELSE IF(@number = 2) BEGIN SELECT COUNT([outlet #]) FROM OM WHERE [address] LIKE '%' + @address + '%'; SELECT [outlet #], [name], address, [city/town], [postal code], telephone FROM OM WHERE address LIKE '%' + @address + '%' END Would it be possible to obtain the # of records and records in one shot Thank u for your time
You would want to use a sub query. I am not sure if what I am showing you will work, but it will be something similar to: SELECT [outlet #], [name], address, [city/town], [postal code], telephone, (SELECT COUNT([outlet #])) FROM OM WHERE address LIKE '%' + @address + '%' Hope that helps. BTW - The query will be analized starting with the sub query, so it will do the COUNT first and then work it's way out. [ September 02, 2002: Message edited by: Gregg Bolinger ]