Quantcast
Channel: SQLServerCentral » SQL Server 2014 » Development - SQL Server 2014 » Latest topics
Viewing all articles
Browse latest Browse all 3145

Getting an error when trying to duplicate some code off of a website. What have I done wrong?

$
0
0
I found an article on the CodeProject website named [url=http://www.codeproject.com/Articles/627421/T-SQL-MapReduce]T-SQL MapReduce[/url]. I'm trying to duplicate the SQL code there into a SQL Server 2914 Developer Edition database I've got, and also the C# code using Visual Studio. I've defined the user data types fine (e.g.: word_t, words_t and so on), but I got an error when I tried to create the UDF dbo.mapper from the page. The error I got was:[quote]Msg 102, Level 15, State 1, Procedure mapper, Line 5Incorrect syntax near 'CALLER'.[/quote]The SQL code I used is straight off of the page; it looks like this:[code=sql]create function dbo.mapper(@documents DocumentsWithAutoIncrementIndexTable READONLY, @sep nvarchar)returns @t TABLE ( wordindex int, word word_t )WITH EXECUTE AS CALLER[/code]What have I done wrong? I'm guessing that the author has done something like left off a variable declaration or something like that. Anyway, what am I missing?

Viewing all articles
Browse latest Browse all 3145

Trending Articles