[SOLVED] How to connect private database with GPT?

Hello everyone,

I was able to discover information regarding Connecting GPTs to databases in the OpenAI documentation, but I was unable to find any assistance in connecting my database to the GPT that I had established.

Edit: I’ve created a custom GPT that can respond to queries depending on files provided, but I now want it to use SQL Server Management Studio (SSMS) to establish a connection to my local database on a server. How exactly can I accomplish that?

Solution:

2 Likes

You need to add more details. What exactly are you stuck on?

Well, I’ve created a custom GPT that can respond to queries depending on files provided, but I now want it to use SQL Server Management Studio (SSMS) to establish a connection to my local database on a server. How exactly can I accomplish that?

GPT Actions work with APIs. You need to have a server that acts as a proxy to your database and establishes a connection. Afterwards, you can create an OpenAPI document and provide it to GPT as an action.

One tip: If you provide a table schema as a knowledge file and ask GPT to produce SQL for given queries, GPT does a pretty good job.

5 Likes

To build off of @barisozcelik excellent response…

In general you need to create an OpenAPI Schema to paste into the Configure / Actions section of your GPT. This general article on Actions will help. And this article could help for the SSMS side of things.

2 Likes

Thanks @cass , however the hyperlinks you supplied go to the same content.

Thank you very much, @barisozcelik . That was effective for me.

1 Like

sorry 'bout that. Just updated to the correct link.

1 Like