Sync Relational model data - unable to see schema

Posts   
 
    
pdonovan
User
Posts: 21
Joined: 06-Mar-2012
# Posted on: 17-Nov-2022 01:54:30   

Hi,

I've recently moved a database from SQL Server to Azure SQL using SSMS's "Deploy database to Microsoft Azure SQL database" feature. When I load our existing project into the designer (v5.8.3) and change its setting to sync with the database in its new location, the wizard does not show me the default schema 'dbo' that we usually use. So I cannot sync. Strangely, if I point the designer at any of the other databases on the same Azure SQL server I can see all the expected schema. The only difference I can think of is that those databases were created in Azure.

This feels like a permissions issue, but the Azure admin user account I'm using in the designer can see the schema if I use SSMS or Azure Data studio. Any suggestions as to why LLBLGen can't see the schema?

Cheers, Paul

pdonovan
User
Posts: 21
Joined: 06-Mar-2012
# Posted on: 17-Nov-2022 02:02:31   

Well, shortly after I posted I found a solution :-)

On the master database on the Azure SQL Server I ran:

SELECT d.name, d.owner_sid, sl.name
FROM sys.databases AS d
JOIN sys.sql_logins AS sl
ON d.owner_sid = sl.sid;

This did NOT list the database in question as being owned by our admin user. It only listed the databases that were acting normally. In fact, the problematic database wasn't listed at all.

So then I switched to the problematic database and ran:

ALTER AUTHORIZATION ON DATABASE::OurSchemaDbWithTheIssue TO [our-sa]

Running the first query again show what I expected, and the LLGLGen sync wizard can correctly see the database schema I wanted.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39760
Joined: 17-Aug-2003
# Posted on: 17-Nov-2022 09:44:55   

Glad you solved it! simple_smile

Frans Bouma | Lead developer LLBLGen Pro