- Assume that you upgrade a SQL Server instance to SQL Server 2019 RTM or later versions, or you restore a database from pre-SQL Server 2019 to SQL Server 2019 RTM or later versions.
- You change the database compatibility level to 150.
- When you create a Transactional Publication on the restored database with all the Tables and User-Defined Functions (UDFs), you notice that the Snapshot agent fails and returns the following error message:
DateTime Exception Message: An invalid option was specified for the statement "CREATE/ALTER FUNCTION".
DateTime A RETURN statement with a return value cannot be used in this context.
DateTime Message Code: 487