Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reverse Engineer Fails with SQL Server 2008 #9

Closed
ErikEJ opened this issue May 19, 2018 · 10 comments
Closed

Reverse Engineer Fails with SQL Server 2008 #9

ErikEJ opened this issue May 19, 2018 · 10 comments
Labels
Milestone

Comments

@ErikEJ
Copy link
Owner

ErikEJ commented May 19, 2018

From @matthewDDennis on May 7, 2018 19:44

System.Data.SqlClient.SqlException (0x80131904): 'CONCAT' is not a recognized built-in function name.
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action1 wrapCloseInAction) at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action1 wrapCloseInAction)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
at System.Data.SqlClient.SqlDataReader.TryConsumeMetaData()
at System.Data.SqlClient.SqlDataReader.get_MetaData()
at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString, Boolean isInternal, Boolean forDescribeParameterEncryption, Boolean shouldCacheForAlwaysEncrypted)
at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, Boolean inRetry, SqlDataReader ds, Boolean describeParameterEncryptionRequest)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource1 completion, Int32 timeout, Task& task, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method) at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method) at System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior) at System.Data.Common.DbCommand.ExecuteReader() at Microsoft.EntityFrameworkCore.Scaffolding.Internal.SqlServerDatabaseModelFactory.GetTables(DbConnection connection, Func3 tableFilter, IReadOnlyDictionary2 typeAliases) at Microsoft.EntityFrameworkCore.Scaffolding.Internal.SqlServerDatabaseModelFactory.Create(DbConnection connection, IEnumerable1 tables, IEnumerable1 schemas) at Microsoft.EntityFrameworkCore.Scaffolding.Internal.SqlServerDatabaseModelFactory.Create(String connectionString, IEnumerable1 tables, IEnumerable1 schemas) at Microsoft.EntityFrameworkCore.Scaffolding.Internal.ReverseEngineerScaffolder.ScaffoldModel(String connectionString, IEnumerable1 tables, IEnumerable`1 schemas, String namespace, String language, String outputDbContextDir, String contextName, Boolean useDataAnnotations, Boolean useDatabaseNames)
at ReverseEngineer20.EfCoreReverseEngineer.GenerateFiles(ReverseEngineerOptions reverseEngineerOptions)
at EFCorePowerTools.Handlers.ReverseEngineerHandler.d__2.MoveNext() in C:\projects\sqlcetoolbox\src\GUI\EFCorePowerTools\Handlers\ReverseEngineerHandler.cs:line 157
ClientConnectionId:26b0c024-00ad-446e-8746-fd229c61a88c
Error Number:195,State:10,Class:15

Copied from original issue: ErikEJ/SqlCeToolbox#706

@ErikEJ
Copy link
Owner Author

ErikEJ commented May 19, 2018

What SQL Server version?

@ErikEJ
Copy link
Owner Author

ErikEJ commented May 19, 2018

I am guessing 2008 - I have logged dotnet/efcore#11932

@ErikEJ
Copy link
Owner Author

ErikEJ commented May 19, 2018

From @shadowfoxish on May 9, 2018 19:44

I was seeing this as well, Microsoft SQL Server 2008 (SP4) - 10.0.6241.0

@ErikEJ ErikEJ changed the title Reverse Engineer Fail in VS15.7.0 Reverse Engineer Fail in VS15.7.0 with SQL Server 2008 May 19, 2018
@ErikEJ ErikEJ changed the title Reverse Engineer Fail in VS15.7.0 with SQL Server 2008 Reverse Engineer Fails with SQL Server 2008 May 19, 2018
@ErikEJ ErikEJ added the reveng label May 24, 2018
@ErikEJ
Copy link
Owner Author

ErikEJ commented May 24, 2018

This will be fixed in EF Core 2.1.1

@r3faat1
Copy link

r3faat1 commented Jul 25, 2018

I am still running into this issue. Version: 10.50.4042.0. Using EF Core 2.1.1 and PowerTool 1.0.604.

System.Data.SqlClient.SqlException (0x80131904): 'CONCAT' is not a recognized built-in function name.
   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
   at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
   at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
   at System.Data.SqlClient.SqlDataReader.TryConsumeMetaData()
   at System.Data.SqlClient.SqlDataReader.get_MetaData()
   at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString, Boolean isInternal, Boolean forDescribeParameterEncryption)
   at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, Boolean inRetry, SqlDataReader ds, Boolean describeParameterEncryptionRequest)
   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry)
   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
   at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)
   at System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior)
   at System.Data.Common.DbCommand.ExecuteReader()
   at Microsoft.EntityFrameworkCore.SqlServer.Scaffolding.Internal.SqlServerDatabaseModelFactory.GetTables(DbConnection connection, Func`3 tableFilter, IReadOnlyDictionary`2 typeAliases)
   at Microsoft.EntityFrameworkCore.SqlServer.Scaffolding.Internal.SqlServerDatabaseModelFactory.Create(DbConnection connection, IEnumerable`1 tables, IEnumerable`1 schemas)
   at Microsoft.EntityFrameworkCore.SqlServer.Scaffolding.Internal.SqlServerDatabaseModelFactory.Create(String connectionString, IEnumerable`1 tables, IEnumerable`1 schemas)
   at Microsoft.EntityFrameworkCore.Scaffolding.Internal.ReverseEngineerScaffolder.ScaffoldModel(String connectionString, IEnumerable`1 tables, IEnumerable`1 schemas, String namespace, String language, String contextDir, String contextName, ModelReverseEngineerOptions modelOptions, ModelCodeGenerationOptions codeOptions)
   at ReverseEngineer20.EfCoreReverseEngineer.GenerateFiles(ReverseEngineerOptions reverseEngineerOptions)
   at EFCorePowerTools.Handlers.ReverseEngineerHandler.<ReverseEngineerCodeFirst>d__2.MoveNext() in C:\projects\efcorepowertools\src\GUI\EFCorePowerTools\Handlers\ReverseEngineerHandler.cs:line 154
ClientConnectionId:07f40b51-0045-4250-9b6f-6c13496ff94a
Error Number:195,State:10,Class:15

@ErikEJ
Copy link
Owner Author

ErikEJ commented Jul 26, 2018

@refx32 Correct, still using EF Core 2.1.0 in Power Tools

@shadowfoxish
Copy link

I moved off SQL 2008 for my development stuff, and that solved it.

@bhaider7
Copy link

bhaider7 commented Oct 7, 2018

I am still getting the same error with SQL 2008 and unfortunately, I can not upgrade.

Environment:
Dot Net Core 2.1
EF Core 2.1.4
Power Tools stable version

Even I tried with the EF Core 2.2.0.preview2-35157 and the latest daily build (1.0.654.0) of Power Tools

Edit:
Scaffold-DbContext works fine with the same database!

@ErikEJ
Copy link
Owner Author

ErikEJ commented Oct 7, 2018

The Power Tools use the 2.1, not 2.1.1 bits. I will wait for 2.2 to be released before I update the Power Tools dependencies

@ErikEJ ErikEJ added this to the efcore-22 milestone Dec 9, 2018
@ErikEJ
Copy link
Owner Author

ErikEJ commented Dec 15, 2018

Fixed in latest daily build

@ErikEJ ErikEJ closed this as completed Dec 15, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants