transfer_function
Move a T-SQL user-defined function to another schema. Works on Data Warehouses and SQL Analytics Endpoints. Note: function definition text is not updated.
Instructions
Move a T-SQL user-defined function to another schema via ALTER SCHEMA TRANSFER.
Function DDL is supported on both Data Warehouses and SQL Analytics Endpoints -- unlike table transfer, no endpoint guard applies here.
CAUTION: ALTER SCHEMA ... TRANSFER does not rewrite the schema name
inside the function's stored definition (sys.sql_modules.definition).
After a transfer, get_function may still show the old schema name
in the CREATE ... AS header, even though the function now lives in
the new schema. This tool does not rewrite the definition text.
Args:
workspace: Workspace name or GUID.
item: Warehouse or SQL Analytics Endpoint name or GUID.
qualified_name: Current dot-separated qualified function name, e.g.
dbo.fn_clean_input.
target_schema: Schema to move the function into, e.g. archive.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| item | Yes | ||
| workspace | Yes | ||
| target_schema | Yes | ||
| qualified_name | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||