Hi,
I am having problems with a stored procedure that I am writing for SQL Server.
I am calling a function within the stored procedure which returns a 2 column table with a value. This value I want to assign to a VARCHAR variable to be used throught the rest of my store procedure.
DECLARE @TEAM VARCHAR(100)
SET @TEAM = (SELECT DISTINCT value fn_split(@foldernarrative, '-') WHERE idx = 0)
The function works on its own but when added to my store procedure I get syntax errors such as
Server: Msg 170, Level 15, State 1, Line 94
Line 94: Incorrect syntax near '('.
I'm quite new to this and I can't see why this is a problem.
Any help would be greatfully recieved.
Thanks.