Issue with CREATE UPDATE TABLE in MSSQL with db_ddladmin permission

RoseTeq 20 Reputation points
2024-03-03T11:51:34.4366667+00:00

I am unable to update or create tables within Visual Studio 2022 and SSMS, despite having db_ddladmin permissions. Both Update and Execute buttons are disabled. This issue has persisted for over a week, and I have not made any user changes or updates. I have checked the assigned permissions and contacted the server hosting company, but they cannot identify any issues. Can anyone suggest a solution?

Screenshots: Screenshot 2024-02-22 175323

Screenshot 2024-02-26 111518

Screenshot 2024-03-03 100254

Developer technologies | Visual Studio | Other
Developer technologies | Visual Studio | Other
A family of Microsoft suites of integrated development tools for building applications for Windows, the web, mobile devices and many other platforms. Miscellaneous topics that do not fit into specific categories.
SQL Server | Other
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Erland Sommarskog 128.7K Reputation points MVP Volunteer Moderator
    2024-03-03T14:13:56.79+00:00

    When it comes to SSMS, it is exactly what the error message says. You need to be member of db_owner. When it comes to SQL Server itself, it's perfectly sufficient to be member of db_ddladmin, but the crippled Table Designer in SSMS is a very old piece of junk, and it only checks for db_owner. (I can see this by runnin a Trace against SSMS.)

    I'm less certainly about Visual Studio. When I test with a user that is only member of db_ddladmin, I don't even come as far as you seem to do, but I see this:

    User's image

    I also tried Azure Data Studio, but this did not work any better. I got the message: An error occurred while initializing the table designer: Failed to initialize the table model.

    Thankfully, there is a workaround for all of this: Simply type the CREATE TABLE statements and skip the designers.


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.