Native Compiled Functions not working?
guruper2
Posts: 6 Bronze 1
I have several function native compiled functions in my SQL Server 2016 SP1 database. I get an error on all of them trying to sync between my database and source control system. The same goes for SQL Source Control. Is SQL Compare and SQL Source Control not compatible with native compiled functions and procedures?
Here is a sample of an SQL with syntax error (according to SQL Compare). I works fine on SQL Server 2016:
CREATE FUNCTION [dbo].[cf_GetWordID] (@WordValue varchar(200))
RETURNS int
WITH NATIVE_COMPILATION, SCHEMABINDING
AS
BEGIN ATOMIC WITH (TRANSACTION ISOLATION LEVEL = SNAPSHOT, LANGUAGE = N'English')
DECLARE @WordID int=0;
IF @WordValue!=''
SET @WordID=ISNULL((SELECT WordID FROM dbo.WordList WHERE WordValue=@WordValue),-1)
RETURN (@WordID)
END
GO
Here is a sample of an SQL with syntax error (according to SQL Compare). I works fine on SQL Server 2016:
CREATE FUNCTION [dbo].[cf_GetWordID] (@WordValue varchar(200))
RETURNS int
WITH NATIVE_COMPILATION, SCHEMABINDING
AS
BEGIN ATOMIC WITH (TRANSACTION ISOLATION LEVEL = SNAPSHOT, LANGUAGE = N'English')
DECLARE @WordID int=0;
IF @WordValue!=''
SET @WordID=ISNULL((SELECT WordID FROM dbo.WordList WHERE WordValue=@WordValue),-1)
RETURN (@WordID)
END
GO
Tagged:
Comments
Thanks for you posts. I can confirm that while SQL Compare works with native compiled stored procedures, we do not currently support this option for functions.
I've logged this as a feature request with reference SC-9266. Unfortunately I can't confirm when we might be working on this, but we will keep this forum thread updated with any further progress.
Regards,
David
Redgate Software
At present we are aware of deployment issues with:
- Temporal tables
- Native compiled functions
- Keys associated with Always Encrypted functionality
If there are other features that you are encountering issues with we would like to hear about them. We want to make sure we are targeting the most valuable features first.
Redgate Software
Redgate Software