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 2000 Forums
 SQL Server Development (2000)
 Reuseable Parameter Parsing Utility

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2001-07-12 : 09:03:08
Dan writes "There are occasions where I need to filter a recordset based on multiple possible values. While this can be done with a Sub Query and with Dynamic SQL, I would prefer if there were a way that I could parse a string parameter into varchar or integer values, insert the values into a table, and join directly to that table.

With that in mind, I altered some code from this site that parses delimited strings. I created a temp table (#ArrayTable) and populated it with the parsed values. Bad news. If I use a local temp table in the utility procedure, the calling procedure can't see #ArrayTable. Obviously, creating ##ArrayTable as a global temp table will work, but not for multiple users.

The only solution that I've found is to create #ArrayTable in the calling procedure. In that scenario, both the calling procedure and the utility procedure have access to the data. My concern is that the two may be too tightly coupled.

Should I be concerned?
Am I better off with dynamic SQL?"
   

- Advertisement -