You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
An error occurs when ExecuteNonQuery() a script that has a "caution" message and FireInfoMessageEventOnUserErrors = true. My Script uses SP_RENAME and has "Caution: Changing any part of an object name could break scripts and stored procedures." message.
SqlException.CreateException() => command?.GetCurrentBatchCommand() =>return _rpcArrayOf1[0].batchCommand, where _rpcArrayOf1 is null, cause never initialized. That throws NullReferenceException.
To reproduce
C# .NET 8 with Microsoft.Data.SqlClient
Simple script with SP_RENAME
FireInfoMessageEventOnUserErrors = true
ExecuteNonQuery()
Expected behavior
I'd like to be able to execute a script with FireInfoMessageEventOnUserErrors = true, even if it's not a batch.
Is that an error or do I miss something?
The text was updated successfully, but these errors were encountered:
SqlException.CreateException calls for command?.GetCurrentBatchCommand()) even if there's no batch
While switching from (1) System.Data.SqlClient to (2) Microsoft.Data.SqlClient I got an error caused by this change of code:
An error occurs when ExecuteNonQuery() a script that has a "caution" message and FireInfoMessageEventOnUserErrors = true. My Script uses SP_RENAME and has "Caution: Changing any part of an object name could break scripts and stored procedures." message.
SqlException.CreateException() => command?.GetCurrentBatchCommand() =>return _rpcArrayOf1[0].batchCommand, where _rpcArrayOf1 is null, cause never initialized. That throws NullReferenceException.
To reproduce
Expected behavior
I'd like to be able to execute a script with FireInfoMessageEventOnUserErrors = true, even if it's not a batch.
Is that an error or do I miss something?
The text was updated successfully, but these errors were encountered: