CREATE EXTERNAL MODEL
defines an external model used by AI_GENERATE_EMBEDDINGS
What changes
- Input
- catalog
- Output or change
- external AI model definition (endpoint location, API format, credential)
Syntax at a glance
CREATE EXTERNAL MODEL external_model_object_name [ AUTHORIZATION owner_name ] WITH ( LOCATION = '<prefix>://<path>[:<port>]' , API_FORMAT = '<OpenAI, Azure OpenAI, etc>' , MODEL_TYPE = EMBEDDINGS , MODEL = 'text-embedding-model-name' [ , CREDENTIAL = <credential_name> ] [ , PARAMETERS = '{"valid":"JSON"}' ] [ , LOCAL_RUNTIME_PATH = 'path to the ONNX Runtime files' ] );
Work example
A SQL Server 2025 workload needs an approved external model for embedding calls.
Review the endpoint, API format, model name, credential reference, and outbound network path with the platform owner.
Check your work The endpoint is allowlisted and the credential name resolves without exposing its secret.
Open Microsoft Learn for full syntax, permissions, and details for your version.