Free tools Windows power users keep installed
One-click scans. No signup required.
Run generative AI on Snowflake table data by calling Cortex AI functions in a SQL query. For general-purpose text generation, Snowflake recommends AI_COMPLETE: build a prompt from each row’s columns, select the result with a stable key, and review any rows that fail. The example below is a template, not tested SQL; confirm the model and syntax supported for your account and region.
Choose the Cortex function for the job
Use a task-specific function where it fits rather than treating every AI operation as free-form generation. Snowflake’s Cortex AI Functions guide lists functions for generation, classification, filtering, aggregation, extraction, translation, embeddings, summarization, and document processing; availability and Preview status vary by function.
As an Amazon Associate I earn from qualifying purchases.
| Task | Function direction | What it does |
|---|---|---|
| Generate or transform text from row fields | AI_COMPLETE |
Creates a response from a prompt; Snowflake recommends it for most generative AI tasks. Snowflake |
| Assign one or more labels you define | AI_CLASSIFY |
Classifies input against user-specified categories. More than 20 categories may reduce accuracy in practice. Snowflake |
| Keep rows that meet a natural-language condition | AI_FILTER |
Returns a Boolean that can be used in SQL filtering expressions. Snowflake |
| Find insights across multiple text rows | AI_AGG |
Produces insights across multiple rows in response to a user-defined prompt. Snowflake |
| Process document content in stages | AI_PARSE_DOCUMENT, AI_EXTRACT, and related functions |
Document parsing and extraction can be combined with classification, Cortex Search, and AI_COMPLETE in document analytics and retrieval-augmented generation workflows. Snowflake |
Run a generation query over table rows
A scalar AI call in a SELECT can use column values to build a prompt for each row. Keep a stable identifier in the result so you can match generated text back to its input.
The Tool Desk
Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →SELECT
id,
AI_COMPLETE(
'<supported_model>',
'Summarize this review in one sentence: ' || review_text
) AS summary
FROM reviews;
This illustrates the pattern, not a guaranteed drop-in query. Check the current AI_COMPLETE reference for supported models and argument forms available to your account.
#1 Best Overall
Check access and regional availability
Before running a query, confirm access for the function you chose. Snowflake’s Cortex overview describes the account-level USE AI FUNCTIONS privilege and either the CORTEX_USER or AI_FUNCTIONS_USER database role. The individual AI_COMPLETE reference specifically lists SNOWFLAKE.CORTEX_USER. Consult the applicable function reference and your account configuration rather than assuming one role requirement covers every function. Cortex AI Functions are available only in select regions, and some functions are Preview Features. Snowflake’s overview describes these access and availability conditions.
Handle failed rows explicitly
By default, AI_COMPLETE returns NULL for an input it cannot process. In a multirow query, an error on one row does not necessarily prevent other rows from completing. If you need diagnostics, use the optional return_error_details argument: the result includes value and error fields. Retain the row key and inspect failures instead of treating every returned row as a successful generation. Snowflake documents the error behavior and argument.
Rank #2
Plan the workload and cost
For numerous inputs, Snowflake says batch processing is typically better suited to AI Functions; its guide points to REST APIs when interactive latency is the priority. That is workload guidance, not a runtime or quality guarantee for a particular table. Benchmark the query with your data and prompt before setting expectations. Snowflake’s guide
There is no task-specific cost figure established here. For reusable CREATE AI FUNCTION calls, Snowflake says Cortex inference is metered separately from query compute. The command is labeled a Preview Feature in the CREATE AI FUNCTION reference, so assess preview status and deployment readiness alongside governance, error handling, and expected inference use.
Rank #3
Package repeated logic as a SQL function
If the same scalar AI expression should be shared across queries, CREATE AI FUNCTION packages it under a named SQL function that can be invoked per row. The command reference includes a row-invocation example, but labels the feature Preview; check its current status and suitability for your account before relying on it in production. Its inference metering is separate from query compute, as described in the command reference.
Quick Recap
Best Value
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




