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 |
|
dawillia
Starting Member
2 Posts |
Posted - 2004-07-23 : 15:03:03
|
| Is it good practice to add and remove tables in a stored procedure? |
|
|
eyechart
Master Smack Fu Yak Hacker
3575 Posts |
Posted - 2004-07-23 : 15:05:37
|
| temp tables yes. I would not want to add or drop 'real' tables from a sproc though.What exactly are you wanting to do? With a little background info, we can help you work out your code.-ec |
 |
|
|
dawillia
Starting Member
2 Posts |
Posted - 2004-07-23 : 16:07:22
|
| This is what I am trying to do, and I am not sure of what is the best solution. I have an input parameter which is a delimited string. I want to loop through that string, get the values, then do a search in a table (about 15 records). I heard that looping through comma delimited string in sql is time consuming. So, I thought about loading the string on a table and matching its values against other table.In other words:These are the values that could be on the table.fldStatus = 'CR,CL,,PD........'This is the string I want to loop throughMyString = 'DE,KI,FG,CR,KJ,CL'When the loop for MYString hits the index for CR, I want to stop the loop, and get that record. Once it finds the first match I want to stop the loop. . I don't want the match for CL since CR is priority. |
 |
|
|
X002548
Not Just a Number
15586 Posts |
Posted - 2004-07-23 : 16:35:26
|
| You're going to need some user defined functions...I'll see hwat I can dig up...Come Monday....It'll be alright....Margarita TIME!Brett8-) |
 |
|
|
Kristen
Test
22859 Posts |
Posted - 2004-07-24 : 00:43:52
|
| what tells you that you want to stop at CR? Are there other values you would stop at?Kristen |
 |
|
|
|
|
|
|
|