<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/building-agentic-ai-patterns-with-amazon-bedrock-and-sql-server-2025-on-amazon-rds-gu2migzkd" -->

---
title: Building agentic AI patterns with Amazon Bedrock and SQL...
description: SQL Server 2025 on Amazon RDS introduces sp_invoke_external_rest_endpoint, a system stored procedure that enables native HTTPS REST API calls directly from...
canonical: https://daily.dev/posts/building-agentic-ai-patterns-with-amazon-bedrock-and-sql-server-2025-on-amazon-rds-gu2migzkd
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Building agentic AI patterns with Amazon Bedrock and SQL Server 2025 on Amazon RDS | daily.dev
og:description: SQL Server 2025 on Amazon RDS introduces sp_invoke_external_rest_endpoint, a system stored procedure that enables native HTTPS REST API calls directly from...
og:url: https://daily.dev/posts/building-agentic-ai-patterns-with-amazon-bedrock-and-sql-server-2025-on-amazon-rds-gu2migzkd
og:image: https://api.daily.dev/og/posts/Gu2MIGzKD.png
og:image:alt: Building agentic AI patterns with Amazon Bedrock and SQL Server 2025 on Amazon RDS
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Building agentic AI patterns with Amazon Bedrock and SQL Server 2025 on Amazon RDS

**[AWS Database Blog](https://daily.dev/sources/aws-database-blog)** · 8 min read · 1 upvotes · 0 comments

## Summary

SQL Server 2025 on Amazon RDS introduces sp_invoke_external_rest_endpoint, a system stored procedure that enables native HTTPS REST API calls directly from T-SQL. This eliminates the need for middleware layers like Lambda functions or API Gateway when integrating AI into database workflows. The post walks through secure credential setup using Database Scoped Credentials, then demonstrates four production-ready stored procedures: an AI-powered query advisor, automated wait stats analysis using sys.dm_os_wait_stats, real-time support ticket triage, and event-driven AI via database triggers. Key considerations include the 30-second timeout, synchronous execution per session, and the 12-hour expiration of Bedrock API keys requiring automated rotation.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://aws.amazon.com/blogs/database/building-agentic-ai-patterns-with-amazon-bedrock-and-sql-server-2025-on-amazon-rds>

## Questions this post answers

### How can I call Amazon Bedrock directly from T-SQL in SQL Server 2025 on Amazon RDS?

SQL Server 2025 on Amazon RDS introduces the sp_invoke_external_rest_endpoint system stored procedure, which makes native HTTPS REST API calls directly from T-SQL, including calls to Amazon Bedrock foundation models like Claude Sonnet 4. This removes the need for Lambda functions or API Gateway middleware, letting stored procedures call Bedrock's Converse API and parse JSON responses with JSON_VALUE directly in the database engine.

_daily.dev surfaces practical walkthroughs like this for teams weighing AI integration approaches inside their database layer._

### How do I keep an Amazon Bedrock API key secure when calling it from SQL Server T-SQL code?

Store the Bedrock API key in a Database Scoped Credential with IDENTITY set to 'HTTPEndpointHeaders', which encrypts the key at rest and injects it as an HTTP header on every request without the key ever appearing in query text, plan cache, or trace logs. Note that Bedrock API keys generated from the model catalog expire after 12 hours, so rotation should be automated via a SQL Agent job or external scheduler.

_engineers securing credentials for AI-database integrations can track patterns like this through daily.dev._

### What is the default timeout for sp_invoke_external_rest_endpoint in SQL Server 2025 and how should high-throughput AI calls be handled?

The sp_invoke_external_rest_endpoint procedure has a default timeout of 30 seconds, which is typically sufficient since Amazon Bedrock responds in 1 to 5 seconds. Each call is synchronous within its session, so for high-throughput scenarios it is recommended to queue requests through Amazon SQS rather than invoking Bedrock directly from every transaction, and to always wrap trigger-based calls in TRY/CATCH so external service failures never roll back the business transaction.

_daily.dev helps developers planning production AI-in-database workloads stay ahead of concurrency and reliability gotchas._

## Similar posts on daily.dev

- [Invoke AWS services directly from Amazon RDS for SQL Server 2025](https://daily.dev/posts/invoke-aws-services-directly-from-amazon-rds-for-sql-server-2025-svjqn5j6g) · AWS Database Blog · 0 upvotes · 0 comments
- [Introducing Amazon Bedrock Managed Knowledge Base for faster, more accurate enterprise AI applications](https://daily.dev/posts/introducing-amazon-bedrock-managed-knowledge-base-for-faster-more-accurate-enterprise-ai-applicatio-lfogbfa0k) · AWS · 0 upvotes · 0 comments
- [Natural language queries on Oracle Database 26ai: Getting started with Select AI on Amazon RDS for Oracle with Amazon Bedrock](https://daily.dev/posts/natural-language-queries-on-oracle-database-26ai-getting-started-with-select-ai-on-amazon-rds-for-o-fg4chzhty) · AWS Database Blog · 0 upvotes · 0 comments
- [From 'Works on My Machine' to Production-Ready: Building AI Agents with Amazon Bedrock AgentCore](https://daily.dev/posts/from-works-on-my-machine-to-production-ready-building-ai-agents-with-amazon-bedrock-agentcore-bt6s0repy) · Pulumi · 1 upvotes · 0 comments

---

Tags: [#aws](https://daily.dev/tags/aws), [#microsoft-sql-server](https://daily.dev/tags/microsoft-sql-server), [#agentic-ai](https://daily.dev/tags/agentic-ai), [#amazon-bedrock](https://daily.dev/tags/amazon-bedrock)

[View this post on daily.dev](https://daily.dev/posts/building-agentic-ai-patterns-with-amazon-bedrock-and-sql-server-2025-on-amazon-rds-gu2migzkd)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Building agentic AI patterns with Amazon Bedrock and SQL Server 2025 on Amazon RDS","url":"https://daily.dev/posts/building-agentic-ai-patterns-with-amazon-bedrock-and-sql-server-2025-on-amazon-rds-gu2migzkd","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/building-agentic-ai-patterns-with-amazon-bedrock-and-sql-server-2025-on-amazon-rds-gu2migzkd"},"datePublished":"2026-07-20T23:02:47.468Z","dateModified":"2026-09-13T19:16:08.909Z","description":"SQL Server 2025 on Amazon RDS introduces sp_invoke_external_rest_endpoint, a system stored procedure that enables native HTTPS REST API calls directly from...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/11cdf541bbb1e671bced19604dabbe7b?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/11cdf541bbb1e671bced19604dabbe7b?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"AWS Database Blog","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"AWS Database Blog","logo":"https://media.daily.dev/image/upload/s--En-avd2a--/f_auto,q_auto/v1780213446/logos/aws-database-blog?_a=BAMAMiWQ0","url":"https://daily.dev/sources/aws-database-blog"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/building-agentic-ai-patterns-with-amazon-bedrock-and-sql-server-2025-on-amazon-rds-gu2migzkd","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":1},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"aws,microsoft-sql-server,agentic-ai,amazon-bedrock","timeRequired":"PT8M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"AWS Database Blog","item":"https://daily.dev/sources/aws-database-blog"},{"@type":"ListItem","position":3,"name":"Building agentic AI patterns with Amazon Bedrock and SQL Server 2025 on Amazon RDS"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/building-agentic-ai-patterns-with-amazon-bedrock-and-sql-server-2025-on-amazon-rds-gu2migzkd#faq","mainEntity":[{"@type":"Question","name":"How can I call Amazon Bedrock directly from T-SQL in SQL Server 2025 on Amazon RDS?","acceptedAnswer":{"@type":"Answer","text":"SQL Server 2025 on Amazon RDS introduces the sp_invoke_external_rest_endpoint system stored procedure, which makes native HTTPS REST API calls directly from T-SQL, including calls to Amazon Bedrock foundation models like Claude Sonnet 4. This removes the need for Lambda functions or API Gateway middleware, letting stored procedures call Bedrock's Converse API and parse JSON responses with JSON_VALUE directly in the database engine. daily.dev surfaces practical walkthroughs like this for teams weighing AI integration approaches inside their database layer."}},{"@type":"Question","name":"How do I keep an Amazon Bedrock API key secure when calling it from SQL Server T-SQL code?","acceptedAnswer":{"@type":"Answer","text":"Store the Bedrock API key in a Database Scoped Credential with IDENTITY set to 'HTTPEndpointHeaders', which encrypts the key at rest and injects it as an HTTP header on every request without the key ever appearing in query text, plan cache, or trace logs. Note that Bedrock API keys generated from the model catalog expire after 12 hours, so rotation should be automated via a SQL Agent job or external scheduler. engineers securing credentials for AI-database integrations can track patterns like this through daily.dev."}},{"@type":"Question","name":"What is the default timeout for sp_invoke_external_rest_endpoint in SQL Server 2025 and how should high-throughput AI calls be handled?","acceptedAnswer":{"@type":"Answer","text":"The sp_invoke_external_rest_endpoint procedure has a default timeout of 30 seconds, which is typically sufficient since Amazon Bedrock responds in 1 to 5 seconds. Each call is synchronous within its session, so for high-throughput scenarios it is recommended to queue requests through Amazon SQS rather than invoking Bedrock directly from every transaction, and to always wrap trigger-based calls in TRY/CATCH so external service failures never roll back the business transaction. daily.dev helps developers planning production AI-in-database workloads stay ahead of concurrency and reliability gotchas."}}]}
```

