Share via

Azure Data Warehouse function has problem when we create dacpac file in Visual studio 2019

Nandini S 21 Reputation points
Jun 2, 2021, 10:13 AM

I have created a database project where my source and target is Azure SQL Datawarehouse in Visual Studio 2019 by importing the database. When I perform build, it throws me an error for function as below:

Error SQL71636: You cannot use types or statements that modify the database state.

Below is the function definition used:

CREATE FUNCTION [dbo].[fn_Customer] (@CustomerId [bigint]) RETURNS TABLE
AS
RETURN (
SELECT CustomerId,CustomerEmail
FROM Dimcustomer WHERE CustomerId = @CustomerId

)

Since this is already present in the Datawarehouse it should not create an issue while creating a dacpac file. Can you let me know if anyone has faced similar issue?

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.
5,003 questions
{count} votes

7 answers

Sort by: Most helpful
  1. WZIAFP 157 Reputation points
    Mar 8, 2022, 11:46 AM

    Also having this issue. its a bugger to say the least

    0 comments No comments

  2. Vicky G 1 Reputation point
    Nov 9, 2022, 7:35 AM

    I encountered same error while building project having a function. Is there any update on this issue yet? Is there any work around?


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.