Hello. There is no way to join table valued functions with non-static argument in MS SQL 2000.
For instance the code with static string will work
SELECT Results.value
FROM ##NameSplitedOnSpace AS tbl
JOIN dbo.fn_SplitString('my_sample', '-') AS Results
ON Results.MyColumn = tbl.MyOtherColumn
While the code with specified table's column will not.
Consider to use cursor for this purpose. This might have a bigger code but you'll maintain compatibility.
DECLARE @val AS varchar (255)
DECLARE @v_table TABLE ( )
DECLARE vals CURSOR FOR
SELECT tbl.idx
FROM ##NameSplitedOnSpace as tbl
OPEN vals
FETCH NEXT FROM vals INTO @val
WHILE @@FETCH_STATUS = 0
BEGIN
INSERT INTO @v_table
SELECT *
FROM dbo.fn_SplitString(@val, '-')
FETCH NEXT FROM vals INTO @val
END
CLOSE vals
DEALLOCATE vals
SELECT * FROM @v_table
Hope it would be helpful.
Good luck :)