It seems your SQL Server compatibility level is incorrect.
First you can check what it is
SELECT compatibility_level FROM sys.databases
WHERE name = 'ASPSnippets'
![](https://www.aspsnippets.com/Handlers/DownloadFile.ashx?File=d290e193-1806-4010-8240-e142fec1c537.png)
Then you can set it to 130. In order to use the function.
ALTER DATABASE [ASPSnippets]
SET COMPATIBILITY_LEVEL = 130
SELECT compatibility_level FROM sys.databases
WHERE name = 'ASPSnippets'
![](https://www.aspsnippets.com/Handlers/DownloadFile.ashx?File=d6059aa6-700f-47f3-8fbf-5945ddc02f7a.png)
After that when you try again, it will work.
![](https://www.aspsnippets.com/Handlers/DownloadFile.ashx?File=f8fb5e90-b9d2-459e-9244-f03375e06f17.png)