Azure Synapse Lake Database on SQL Serverles Pool Error: Operation DROP FUNCTION is not allowed for a replicated database.

Anonymous
2022-07-27T10:45:58.503+00:00

Hello Community,

When I attempt to execute the following code on our Azure Synapse Lake Database I get the error:

Operation DROP FUNCTION is not allowed for a replicated database.  

The code that generates the error is as follows:

DECLARE @FunctionScript nvarchar(max) = 'IF object_id(N''dbo.GetOptionSetLabel'') is not null DROP FUNCTION [dbo].[GetOptionSetLabel]'  

This is executed SQL Serverless pool built-in
Can someone let me know how to deal with this issue on Synapse Serverless pool?

Azure Synapse Analytics
Azure Synapse Analytics
An Azure analytics service that brings together data integration, enterprise data warehousing, and big data analytics. Previously known as Azure SQL Data Warehouse.
4,467 questions
{count} votes

1 answer

Sort by: Most helpful
  1. AnnuKumari-MSFT 31,721 Reputation points Microsoft Employee
    2022-08-02T06:21:07.963+00:00

    Hi anonymous user ,

    Welcome to Microsoft Q&A platform and thanks for posting your question.

    As I understand your issue, you are trying to drop a function from Synapse serverless SQL pool but you are getting this error "Operation DROP FUNCTION is not allowed for a replicated database" . Please let me know if that's not the case.

    This error is returned when you try to create objects in a database that's shared with Spark pool. The databases that are replicated from Apache Spark pools are read only. You can't create new objects into a replicated database by using T-SQL.

    Create a separate database and reference the synchronized tables by using three-part names and cross-database queries.

    For more details , kindly go through this article: Operation isn't allowed for a replicated database

    Hope this will help. Please let us know if any further queries. Thankyou.

    ------------------------------

    • Please don't forget to click on 130616-image.png button and take satisfaction survey whenever the information provided helps you.
      Original posters help the community find answers faster by identifying the correct answer. Here is how
    • Want a reminder to come back and check responses? Here is how to subscribe to a notification
    • If you are interested in joining the VM program and help shape the future of Q&A: Here is how you can be part of Q&A Volunteer Moderators