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
 SQL Server Administration (2005)
 Lengthy Stored Procedure

Author  Topic 

ChaitraVenkatesh
Starting Member

1 Post

Posted - 2008-02-12 : 01:05:06
Hai friends,

The project i'm working on is an asp.net project with SQL Server 2000 as the database tool.

I've a listbox (multiline selection) in my form, whose selected values will be concatenated and sent to the server as comma separated numbers (Fro ex: 34,67,23,60).Also, the column in the table at the back end contains comma separated numbers (For ex: 1,3,7,34,23).

What i need to do is -

1. Select the rows in the table where the latter example has atleast one value of the former example (In the above ex: 34 and 23).

2. Check the text value of these numbers in another table (master table) and populate the text value of these numbers in a comma separated format in a grid in the front end.

I've programmed a procedure for this. but it takes more than 3 minutes to return the result. Also the table has over 20,000 rows and performance should be kept in mind.

Suggessions on using the front-end (asp.net 2.0) concepts would also be a good help.

I'll explain what i've done-

There is a table say Table1 which has 15 columns and over 20,000 rows. One column is Method, which has comma separated values (23,56,2,78,35). There is a master table MethodMaster, which has some definitions for all these numbers

Id MethodName
23 MethodA
56 MethodB

The listbox in the form will have values populated from MethodMaster table. When the user selects both, comma separated value (23,56) is sent to the server.Now, i need to split these values, check whether atleast one values exists in the Table1 table's Method column. if it exists, then all the MethodName of the value in Method column should be populated in the grid in the front end. (MethodA,MethodB)


Anybody's helping thought would be greatly appreciated...

Thank you
   

- Advertisement -