efcore: Reverse Engineer: Scaffolding fails on Azure Sql Server v11 and SQL 2008 because sequences are not supported

Steps to reproduce Scaffold-DbContext -Provider "Microsoft.EntityFrameworkCore.SqlServer" -Context "DbMercurySchool" -OutputDir "DataModel" -Connection "Server=[Sql Azure Database Server];Data Source=[Sql Azure Database];Initial Catalog=MercurySchool;Persist Security Info=False;User ID=[User ID ];Password=[My Password];Pooling=False;MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Connection Timeout=30;"

The issue: SQL error thrown

Error Number:208,State:1,Class:16 One or more errors occurred. (Invalid object name 'sys.sequences'.)

See attached file.

scaffold_error.txt

EF Core

  • version: 1.0.0-rc2-final
  • Operating system: Win 10
  • Visual Studio version: VS 2015 Community

Other details about my project setup:

So far database has one table. The schema for the table is academy not dbo.

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Reactions: 1
  • Comments: 22 (13 by maintainers)

Commits related to this issue

Most upvoted comments

Azure Data Warehouse uses a different version numbering scheme. The latest version at this date is 10.0.9999.0.

Maybe it should check the compatibility level, rather than the version number. The compatibility level is 130, which is probably fine.

Edit: looks like Azure Data Warehouse doesn’t currently support sequences. Thus, the compatibility level would not actually detect this. Ideally, a real feature detection would be attempted, such as seeing if a query on sys.sequences returns anything.

Here’s my attempt

https://github.com/symbiogenesis/EntityFrameworkCore/commit/b8d814740adbc2afe47355b1bb4246abead521a3

Yes, this is still an issue, if you wish to continue to support Azure SQL Database v11, which has been retired: https://docs.microsoft.com/en-us/azure/sql-database/sql-database-faq - othewise close

See my comment above: https://github.com/aspnet/EntityFrameworkCore/issues/5553#issuecomment-222294947