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
 General SQL Server Forums
 New to SQL Server Programming
 Working with parameters and stored procedures

Author  Topic 

Sanchez33333
Starting Member

1 Post

Posted - 2009-11-12 : 12:09:51
Hi there,

I have an interesting problem which has stretched my SQL Server knowledge to the limit!

Basically, I am setting up an automated system which generates reports based on info taken from two systems (i.e. which customer info on one system is not yet on another, by product, age etc) - It may sound complicated but I've already managed to write the actual 'matching' queries.

But what I need now is to write a starting query that tells the system which usp to run depending on various details (which I have stored in a reference table)

I have tried soo many different methods to get this to work but it seems you just cannot start with a list and filter it through an sp. So this is my last resort I guess! If any of you have any ideas, different approaches or whatever then please do help! I'm open to trying anything!

Thanks alot,
Sanchez.

Lamprey
Master Smack Fu Yak Hacker

4614 Posts

Posted - 2009-11-12 : 12:19:43
I'm not sure what you mean by: "cannot start with a list and filter it through an sp."

But, perhaps you mean a delimited list or array (comma separated for example)? If so, then you can use a Parse String function that returns a table and either use that result to join to or you can put the result in the table variable or temp table and do what you want with it.

If that is not what you are talking about then we'd need more information in order to help you out. Here is a link that may help you provide us more information about your issue:
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2009-11-12 : 12:31:01
can you post the table ddl, sample data and what the expected results should be?

If the data is x, then do y


????



Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

Add yourself!
http://www.frappr.com/sqlteam



Go to Top of Page
   

- Advertisement -