Is it possible??I have a function table with three parameters (It selects the specific field I need from joins 3 tables and applies some bussiness rules to convert some values to the actual values I need). The function table works fine when using one set of parametes at the timeDeclare @date1 datetime, @clientNo char(5), @clientDivision char(5)Select @date1 = '6/1/2007', @clientNo = '00094', @clientDivision ='00002'Select * From dbo.invoiceClientInfo (@date1, @clientNo, @clientDivision)
But I may have to call this table 1 to 3000+ times in one process and making it one by one with all the round trips will delay the process too much (I believe)So I would like to find a way to retrieve all at once. I tried this codeselect a.*, g.clientNo+g.clientDivision groupLocal from dbo.invoiceClientInfo (g.date1, g.clientNo, g.clientDivision) a cross join (Select '00094' clientNo, '00002' clientDivision, cast('20070601' as datetime) date1Union Select '00094' clientNo, '00028' clientDivision, cast('20070601' as datetime) date1Union Select '00094' clientNo, '00033' clientDivision, cast('20070601' as datetime) date1Union Select '00094' clientNo, '00034' clientDivision, cast('20070601' as datetime) date1Union Select '00094' clientNo, '09992' clientDivision, cast('20070601' as datetime) date1Union Select '00416' clientNo, '00001' clientDivision, cast('20070601' as datetime) date1Union Select '00416' clientNo, '00002' clientDivision, cast('20070601' as datetime) date1Union Select '00416' clientNo, '00003' clientDivision, cast('20070601' as datetime) date1Union Select '00416' clientNo, '00004' clientDivision, cast('20070601' as datetime) date1) G
quote:
I get this message when running on the QAServer: Msg 170, Level 15, State 1, Line 2Line 2: Incorrect syntax near '.'.Server: Msg 170, Level 15, State 1, Line 189Line 189: Incorrect syntax near 'g'.