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

Error: Must declare the scalar variable "@tablename" #2

Open
SuperOfficeDevNet opened this issue Jan 9, 2025 · 0 comments
Open

Error: Must declare the scalar variable "@tablename" #2

SuperOfficeDevNet opened this issue Jan 9, 2025 · 0 comments

Comments

@SuperOfficeDevNet
Copy link
Contributor

SuperOfficeDevNet commented Jan 9, 2025

Works: Microsoft SQL Server 2022 (RTM-GDR) (KB5046057) - 16.0.1130.5
Fails: Microsoft SQL Server 2022 (RTM-CU13) (KB5036432) - 16.0.4125.3

In one of the cumulative updates, SQL Parameters have become case-sensitive and exposed a bug in the MirroringClient which results in the following exception:

Message: Exception: 
Must declare the scalar variable "@tablename". at    at System.Data.SqlClient.SqlConnection.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, 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, 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.ExecuteReader()
   at SuperOffice.Online.Mirroring.MirroringClientImplementation.GetLocalTableInfo(String connectionString, String contextIdentifier, String tableName) in C:\Agent1\_work\3\s\Source\SuperOffice.Online.Mirroring\MirroringClientImplementation.cs:line 267
   at SuperOffice.Online.Mirroring.MirroringClientImplementation.TableSchemaImplementation(String contextIdentifier, TableSchemaInfo[] tables, String clientState) in C:\Agent1\_work\3\s\Source\SuperOffice.Online.Mirroring\MirroringClientImplementation.cs:line 111
   at SuperOffice.Online.Mirroring.MirroringClientService.TableSchema(TableSchemaRequest request) in C:\Agent1\_work\3\s\Source\SuperOffice.Online.Mirroring\MirroringClientService.cs:line 43

A fix has been submitted and awaiting approval and publishing.

We will update the release here when the fix has been published.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant