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
 Transact-SQL (2000)
 Table-valued funciton and passing parameters.

Author  Topic 

Wodzu
Yak Posting Veteran

58 Posts

Posted - 2009-08-18 : 07:04:52
Hi.

I have a table-valued function which looks like this:



CREATE FUNCTION dbo.OrderItems(@OrderID)
RETURNS @Items TABLE
(
ItemID int,
ItemName varchar(40),
ItemQuanity decimal(15,2)
)
AS
BEGIN
INSERT @Items
SELECT Item_ID, Item_Name, Item_Quanity
FROM dbo.Items
WHERE Item_OrderID = @OrderID
RETURN
END



Now, I would like to use this function in a query and select Items from multiple Orders. In other words, I would like to pass multiple @OrderID into this function from other table "at once". I would like to do this in one query.

Is this possible?

I know I could do this in SQL 2005 with CROSS APPLY, but I must be able to do this in SQL 2000.

Thanks for your time.

Nageswar9
Aged Yak Warrior

600 Posts

Posted - 2009-08-18 : 07:25:05
Use Like operator , it will be useful to u
Go to Top of Page

Wodzu
Yak Posting Veteran

58 Posts

Posted - 2009-08-18 : 07:29:48
quote:
Originally posted by Nageswar9

Use Like operator , it will be useful to u



Nageswar9 you don't understand my question.

I don't want to modyfiy inside body of my function. This is only an example.
Go to Top of Page
   

- Advertisement -