SQL Server Q&A

As a software engineer, I focus on .NET, especially asp.net, C#, WCF and so on, and I am also very interested in Search Engine Optimization.

Entries Tagged ‘data provider’

FIX: You cannot insert empty string into Memo, Text, nText, or Blob columns

Symptoms
When you try to insert an empty string into Memo, Text, nText or Blob columns by using the OLE DB .NET data provider, you receive the following exception:

An unhandled exception of type ‘System.InvalidOperationException’ occurred in system.data.dll If you handle this exception within a try-catch block, you receive the following information:

System.InvalidOperationException
System.Data.OleDb.OleDbException: Multiple-Step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done.
Resolution
To work around this problem: For strings, insert a space that has a length greater than zero (such as ” “), instead of using an empty string.If the database has an Allow Nulls setting, select Allow Nulls for the columns in the database, and treat nulls as empty strings.

A “COMPUTE BY statements not supported” exception occurs when you use the COMPUTE BY clause in SQL Server

Symptoms
When you attempt to use the COMPUTE BY clause with the Microsoft SQL Server .NET Data Provider, you receive the following exception:

An unhandled exception of type ‘System.InvalidOperationException’ occurred in system.data.dll.
Additional information: COMPUTE BY statements not supported. Note The COMPUTE BY clause in a SQL Server statement generates subtotals within the result set.
Resolution
This behavior is caused by a limitation of the SQL Server .NET Data Provider.
The SQL Server .NET Data Provider does not support all SQL syntax statements.