What's wrong with this T-SQL :
DECLARE @temp TABLE(ID INT IDENTITY,[Value] VARCHAR(100))
SET @temp = dbo.[fnCSVToTable](',2,3')
What's wrong with this T-SQL :
DECLARE @temp TABLE(ID INT IDENTITY,[Value] VARCHAR(100))
SET @temp = dbo.[fnCSVToTable](',2,3')
I don't think you can assign to the table variable like that (unless it is a new thing in SQL 2008).
At least for SQL2005 you would need to do the following.
DECLARE @temp TABLE(ID INT IDENTITY,[Value] VARCHAR(100))
INSERT INTO @temp
SElECT [value]
FROM dbo.[fnCSVToTable](',2,3')
From the docs for SET
(SQL 2008; SQL 2005) (my emphasis):
@ local_variable
Is the name of a variable of any type except cursor, text, ntext, image, or table.
To populate a table variable, use
INSERT @table_variable
SELECT columns
FROM dbo.fnTableValuedFunction