Error parsing valid SQL
tonywaddle
Posts: 17 Bronze 2
I tried to send this via error report in SQL Source Control but it's timing out:
"There was an error parsing the file "...\dbo.fn_SpidFilter.sql" at line 7, column 40 near the text ."
This prevents the user from committing to source control. Here's the function in question:
SET QUOTED_IDENTIFIER ON;
GO
SET ANSI_NULLS ON;
GO
ALTER FUNCTION dbo.fn_SpidFilter
(
@SpidFilter SMALLINT
)
RETURNS TABLE
WITH SCHEMABINDING, NATIVE_COMPILATION
AS
RETURN SELECT 1 AS fn_SpidFilter
WHERE @spid;
GO
I can work around the problem so don't need a solution, just wanted to raise the bug.
Edit: Turns out I can't work around the problem. I tried to delete the file in question, remove the function from SQL and removed it from GitHub directly and the error persists. I've also tried restarting my machine (thought something may be cached?) and have also re-installed Source Control but I still can't commit to source control.
Any suggestions?
"There was an error parsing the file "...\dbo.fn_SpidFilter.sql" at line 7, column 40 near the text ."
This prevents the user from committing to source control. Here's the function in question:
SET QUOTED_IDENTIFIER ON;
GO
SET ANSI_NULLS ON;
GO
ALTER FUNCTION dbo.fn_SpidFilter
(
@SpidFilter SMALLINT
)
RETURNS TABLE
WITH SCHEMABINDING, NATIVE_COMPILATION
AS
RETURN SELECT 1 AS fn_SpidFilter
WHERE @spid;
GO
I can work around the problem so don't need a solution, just wanted to raise the bug.
Edit: Turns out I can't work around the problem. I tried to delete the file in question, remove the function from SQL and removed it from GitHub directly and the error persists. I've also tried restarting my machine (thought something may be cached?) and have also re-installed Source Control but I still can't commit to source control.
Any suggestions?
Tagged:
Comments
Thanks for posting and so sorry to hear you are having this issue.
If not already, can you please upgrade to the latest version (6.0.8.7147 - January 23rd 2018) and test again?
If problem persists, would you be able to share the script for FUNCTION dbo.fn_SpidFilter so I can try a full reproduction? It's worth trying unlink and relink firstly though.
Tianjiao Li | Redgate Software
Have you visited our Help Center?
Thanks for your reply.
My SQL Source Control is Version 6.0.2.6908. There are no updates available through the application and the same version is offered through the initial URL I was provided to download the tool.
We backed up and restored the DB to a new server and added source control. I was able to commit our most recent changes, but after this the error started again.
The script is in my original message.
Thanks,
Tony
Redgate Software
Thanks for the help @Mike U @Tianjiao_Li