Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

need to hard code the first value selected

Status
Not open for further replies.

HappyAdam

Programmer
May 6, 2010
6
US
I have this idea.
The Silverlight app works by having a customer combo box and it just runs the first one there, not sure why that particular one is there but it happens to have a large amt of rows, 37,000.

If I could hard code to have it start on the smallest customer, maybe we would resolve this issue.
How can I tell the sp to start with customer A?

The stored procedure calls the data that has been stages earlier today. this is what gets called by the silverlight app data service. can i tell it here which customer to be on the top of the combo box list?

USE [PBS]
GO
/****** Object: StoredProcedure [dbo].[SpendAnalyzer] Script Date: 05/06/2010 09:57:18 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

-- [dbo].[SpendAnalyzer] 'northern manor multicare center'
ALTER PROCEDURE [dbo].[SpendAnalyzer]
@customername varchar(50) = NULL
AS
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;

SELECT *
FROM dbo.Staging_SpendAnalyzer
WHERE CUSTNAME = @customername
ORDER BY DateCreated DESC
 
change the order by clause, order it on the customer size ascending (default)

although you might need to introduce joins, counts, groups in order to be able to get the "size" of a customer...

if you post the tables and structures involved, we may be able to help further...

--------------------
Procrastinate Now!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top