Q: Not able to create user defined function in Azure Synapse Studio I tried to create a user defined function in Synapse using Synapse Studio. I have selected the server name and my custom database in editor ribbon.
In editor,  am getting syntax error "Create Function is Incorrect token."
Even with syntax error when I execute the function, I get an error "Create Function permission denied in database."
Could you please help me how to create function in Synapse? Am I doing something wrong?


A: 
Make sure the user requires CREATE FUNCTION permission in the database and ALTER permission on the schema in which the function is being created.

Here is an examples to create a function on Azure Synapse Analytics:
Using a scalar-valued user-defined function to change a data type:
This simple function takes a int data type as an input, and returns a decimal(10,2) data type as an output.

For more details, refer to CREATE FUNCTION - Examples and GRANT Schema Permissions.
