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)
 sub select using a table table valued function

Author  Topic 

yosiasz
Master Smack Fu Yak Hacker

1635 Posts

Posted - 2010-04-06 : 13:14:25
Greetings

When trying the following SQL 2000 does not like but this works perfectly on sql 2005. I have been staring at this too long I was hoping a second set of eyes might see the problem.

INNER JOIN dbo.fnParseValues( (SELECT parm_value FROM dbo.job_parameters), ',') b
ON a.val= b.Val


I get an error that says

Msg 102, Level 15, State 1, Procedure usp_xx, Line 32
Incorrect syntax near '('.
Msg 102, Level 15, State 1, Procedure usp_xx, Line 32
Incorrect syntax near ','.

Thanks!!

<><><><><><><><><><><><><><><><><><><><><><><><><>
If you don't have the passion to help people, you have no passion

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2010-04-06 : 13:17:58
is parm_value field in table dbo.job_parameters containing csv list as values?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

yosiasz
Master Smack Fu Yak Hacker

1635 Posts

Posted - 2010-04-06 : 13:23:51
yes sir it is, comma delimited values

<><><><><><><><><><><><><><><><><><><><><><><><><>
If you don't have the passion to help people, you have no passion
Go to Top of Page

Lamprey
Master Smack Fu Yak Hacker

4614 Posts

Posted - 2010-04-06 : 14:20:59
You could assign the value to a variable and then pass the variable to the function.
Go to Top of Page

yosiasz
Master Smack Fu Yak Hacker

1635 Posts

Posted - 2010-04-07 : 13:44:43
thanks Lamprey I did that and it is working beautiful! Thanks

<><><><><><><><><><><><><><><><><><><><><><><><><>
If you don't have the passion to help people, you have no passion
Go to Top of Page
   

- Advertisement -