SQL Server : can't restore database because of 10GB file limit

5t7ly7z5  于 2023-05-16  发布在  SQL Server
关注(0)|答案(1)|浏览(144)

I just installed Microsoft SQL Server 2022. During setup I chose the developer license.

However anytime I try to restore the database backup, I'm getting the following error:
System.Data.SqlClient.SqlError: CREATE DATABASE or ALTER DATABASE failed because the resulting cumulative database size would exceed your licensed limit of 10240 MB (10GB) per database. (Microsoft.SqlServer.Express.Smo).

I just ran the following query in Management Studio

SELECT SERVERPROPERTY('Edition') AS 'Edition',
       SERVERPROPERTY('LicenseType') AS 'License Type',
       SERVERPROPERTY('NumLicenses') AS 'Number of Licenses',
       SERVERPROPERTY('ProductVersion') AS 'Product Version'

Which reports:

Edition License Type    Number of Licenses  Product Version
Express Edition (64-bit)    DISABLED    NULL    16.0.1000.6

In programs and features I can't see an installation of SQL Server Express.

How can that be? How can I fix it? I already reinstalled SQL Server 2022 two times

Edit: I just noticed that I also have SQL Server Express installed due to Visual Studio setup. When I connect to my database using (localdb)\MSSQLLocalDB I'm getting connected to the Express instance instead of the developer instance.

How can I change that?

yptwkmov

yptwkmov1#

Alright, after some investigation, I got the following setup.

Microsoft SQL Server (developer license) - accessable by connecting to "localhost"
Microsoft SQL Server express (e.g. installed by visual studio) - accessable by connecting to "(localdb)\MSSQLLocalDB"

This way I also have the necessary connection strings.

Bonus: chatGPT completely failed helping me with this issue. ALL HAIL TO STACKOVERFLOW :)

相关问题