Cannot change the default schema from guest to dbo MS SQL

Completed

I'm currently trying to work with an RDS SQL Server instance. The screenshot below shows two queries that I believe prove that my user's default schema is dbo, but in the Schemas tab it is detecting guest as the default schema:

A vast majority of our tables use the dbo schema, but since I can't change my default user I have to prefix everything with dbo. This is a minor inconvenience when writing queries, but it is a huge inconvenience when reading and modifying our existing sprocs many of which are quite large. When I script the sproc definition almost everything is highlighted red and I get no autofill. Purportedly better autofill than SSMS is the main reason I decided to try DataGrip, but I'm not seeing that benefit because I can't figure out how to get DataGrip to recognize the default schema.

I have tried removing and recreating the Data Source, but that didn't make a difference. How do I get it to recognize dbo as the default??

Note that all of the local instances marked in the screenshot DO identify dbo as the correct default schema, so I'm assuming it should be possible with the RDS instances.

Also note that the screenshot was actually taken from Rider 2020.3.3, but I had the same problem when I tried it in DataGrip as well.

2 comments
Comment actions Permalink

Figured it out. Turns out that I had to set a default database when setting up the data source. If I set any database as the default then all of the databases default schema became dbo. Weird, but I'm happy now.

0

Please sign in to leave a comment.