System.Data.SqlClient.SqlException: The text, ntext, and image data types are invalid in this subque

Post here for help with installing or upgrading mojoPortal pre-compiled release packages. When posting in this forum, please provide all relevant details. You may also want to review the installation or upgrading documentation.

If you have questions about using the source code or working with mojoPortal in Visual Studio, please post in the Developer forum.

Post here for help with installation of mojoPortal pre-compiled release packages

When posting in this forum, please try to provide as many relevant details as possible. Particularly the following:

  • What operating system were you running when the bug appeared?
  • What database platform is your site using?
  • What version of mojoPortal are you running?
  • What version of .NET do you use?
  • What steps are necessary to reproduce the issue? Compare expected results vs actual results.

You may also want to review the installation or upgrading documentation.

If you have questions about using the source code or working with mojoPortal in Visual Studio, please post in the Developer forum.

This thread is closed to new posts. You must sign in to post in the forums.
10/2/2008 9:26:57 AM
Gravatar
Total Posts 112

System.Data.SqlClient.SqlException: The text, ntext, and image data types are invalid in this subque

Upgrading from multi-site vanilla version 2.2.5.8 MSSQL 5/21/2008 to mojoportal-2-2-7-3-mssqlreleasefiles.zip I get an error:

Setup is disabled but running setup anyway because current user is an administrator.
Probing system...
File system permissions ok.
MSSQL database connection ok.
database permissions are sufficient to alter schema.
database initial schema already exists.
database core schema needs upgrade.
7 site(s) found.
Running script mojoportal-core - 2.2.6.0 - 00:00:00.1093750
System.Data.SqlClient.SqlException: The text, ntext, and image data types are invalid in this subquery or aggregate expression. at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async) at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe) at System.Data.SqlClient.SqlCommand.ExecuteNonQuery() at mojoPortal.Data.SqlHelper.ExecuteNonQuery(SqlTransaction transaction, CommandType commandType, String commandText, SqlParameter[] commandParameters) at mojoPortal.Data.DBPortal.DatabaseHelperRunScript(String script, String overrideConnectionInfo) at mojoPortal.Data.DBPortal.DatabaseHelperRunScript(FileInfo scriptFile, String overrideConnectionInfo) at mojoPortal.Business.DatabaseHelper.RunScript(Guid applicationId, FileInfo scriptFile, String overrideConnectionInfo) - 00:00:00.1406250

Any suggestions are very much appreciated,
Dale E. Moore

 

10/2/2008 9:34:23 AM
Gravatar
Total Posts 18439

Re: System.Data.SqlClient.SqlException: The text, ntext, and image data types are invalid in this subque

Hi Dale,

This is because you are running MS SQL 2000 and there is an incompatible sql statement in the script.

You can fix it by using a text editor and opening the file /Setup/applications/mojoportal-core/SchemaUpgradeScripts/mssql/2.2.6.0.config

Look for this:

UPDATE mp_ModuleSettings
SET RegexValidationExpression = (SELECT TOP 1 mds.RegexValidationExpression
FROM mp_ModuleDefinitionSettings mds
WHERE mds.ModuleDefId IN (SELECT ModuleDefId
FROM mp_Modules m
WHERE m.ModuleID = mp_ModuleSettings.ModuleID)
AND mds.SettingName = mp_ModuleSettings.SettingName
)
 

and replace it with this:

UPDATE ms
SET ms.RegexValidationExpression = mds.RegexValidationExpression
FROM mp_ModuleSettings ms
JOIN mp_Modules m
ON ms.ModuleID = m.ModuleID
JOIN mp_ModuleDefinitionSettings mds
ON ms.SettingName = mds.SettingName
AND m.ModuleDefId = mds.ModuleDefId

Then visit the setup page again and it should be fixed. I already fixed this for clean installs on SQL 2000, and I will fix this upgrade script now.

Hope it helps,

Joe

10/2/2008 9:50:57 AM
Gravatar
Total Posts 112

Re: System.Data.SqlClient.SqlException: The text, ntext, and image data types are invalid in this subque

Once again, you fly to my rescue; it works beautifully; thanks!!

You must sign in to post in the forums. This thread is closed to new posts.