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.
| Author |
Topic |
|
haldol
Starting Member
1 Post |
Posted - 2001-10-30 : 16:19:00
|
I have a procedure that look at a table that has multiple entries of the same file number depending on the subject code and activity code. I have to take the subject code + activity code, which is also a column name in another table, and store the activity date into that field of the other table. Here's a quick example:Table1:[File Number] [Subject Code] [Activity Code] [Activity Date] 4444 AOC F 12/21/99 Table2 (the one being inserted and updated)[File Number] [column for each subj code+'_'+activtiy code ex: AOC_F] 4444 12/21/99There are over 150 columns in the second table. The problem I'm having is the procedure takes over an hour and a half. It uses a cursor to look at the 101000 results from table 1 and determines the column to insert to on the second table through string concatenation. Is there any way to speed this thing up, maybe different way of writing it, so it only takes maybe 1/20th of the time it's taking now? Any help is appreciated. -Nick |
|
|
|
|
|