I'm writing a FullTextSqlQuery and would like to return all available columns in the result set.

When I specify the columns, e.g. SELECT Title FROM scope() WHERE ("scope" = 'All Sites'), the query works fine.

When I try to select all columns, e.g. SELECT * FROM scope() WHERE ("scope" = 'All Sites'), a QueryMalformedException is raised.

The code for the query execution is:

var sqlQuery = new FullTextSqlQuery(SPContext.Current.Site)
    ResultTypes = ResultType.RelevantResults,
    QueryText = searchQuery
var collectionOfResults = sqlQuery.Execute();

Is it possible to retrieve all available columns, or is there a workaround?

2 Answers 2


AFAIK you have to specifically mention the columns you want.

In the SQL query, you are allowed to use the asterisk (*) to specify that all columns in a table are to be returned. However, no defined and fixed set of properties applies to all documents. For this reason, the SQL asterisk is not permitted in the [columns] setting.



FullTextSqlQuery uses a SQL-like syntax, but is not actually SQL. The query statement is parsed internally by SharePoint and used to query the flat index files generated by the crawler on the file system, as well as to generate real SQL queries which may be executed on the search database.

You therefore cannot use '*', and are limited to specifying only managed properties in your select statement. These properties can be defined in your SSP settings.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.