.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Search query with multiple search feilds

Posted By:      Posted Date: October 26, 2010    Points: 0   Category :Sql Server


I have a search page with four fields. Each field belongs to columns in the database. None of these fields are mandatory, so user can choose which field/feilds they want to enter. I want the search results to be more specific as they enter values in more than one field.

For example.

First name, Last name, Pin code and Mobile are the 4 search fields.


Any help will be appreciated.

Thank you


View Complete Post

More Related Resource Links

Search multiple document library in Query


How to search multiple document library in a sitecollection. these document library has same named : DocLib1, DocLib2, DocLib3 ... they all in a same sitecollection.

How to search document via FullTextSqlQuery or other Search Objects?

If there is another sitecollection structured similiary with this one, how to search all these document library? Can we search all sites documents then use url for filter ?

Thanks a lot.


Search Query From Multiple Tables



I have a order master table in which orderId is PK.

Now i have 5 Diffrent tables in which OrderId is FK. Column Name in each table is same.

I want to find all columns by orderId from all 5 tables. that means If i pass the orderid = 5 then query should check for each table and find the orderId = 5 and get all records from that table.

If you think any logic for solve this problem please write. I really thankfull if i got any clue for this.

Thanks & regards

Shwetamber Chourey


MS SQL Server: Search All Tables, Columns & Rows For Data or Keyword Query

If you need to search your entire database for specific data, this query will come in handy.

So when a client needs a custom report or some sort of custom development using Great Plains, most of the time I will have to track down the data in the system by running this query and find the table(s) it is in.

search multiple words into textbox and populate all records in gridview related those keywords


I have a textbox and a gridview which is bound to a table

what I want to achieve is a solution where lets say there are two records - e.g. "1. Book and 2. Red", i want a user to type in those words and the gridview shows the results as followed;

1. Book

2. Red

I have set up the sql data source and everything and my like operator is this...

LIKE '%' + @record + '%'

how can I solve this problem?

Filter search over multiple text columns


Hi everyone,

I'm working on a library that stores information on various cases. The case table has several columns that contain descriptive strings on what happened in the case. I would like to create a single filter that returns all cases where the search string is found in any of the columns. I've looked at Dynamic Data Filtering, but as far as I can tell, the "Contains" filter only allows you to connect to each column individually. Has anyone tried this?



FAST search query is slow...

Hi, we are using fast search for sharepoint 2010. We are crawling an external data source and this is used for search queries. we have around 30 metadata properties and all are full-text indexed. however, the search operation is slow for a database of 5k records in intranet (webserver and database server are in different geographic regions). typically a 100 item search takes 9-10 sec. it get worse over internet and the search query varies from 10-45 sec for 100 items. Any pointers will be helpful. thanks.  

DateTime custom managed property search fails with " Your query is malformed. Please rephrase your q

I've created a front end search page in Silverlight 4 for SharePoint Search.  Currently we are using WSS 3.0 + Search Server Express 2008 (v  The page interacts with the MOSS version of the search web service at:   <site collection>/_vti_bin/search.asmx The reason for this approach is the unique way the requirements specify the look and behavior of the results.  The built-in Search Center page or web parts will not satisfy these requirements. We are going into production but I still cannot figure out how to search against my custom managed properties that are of Type DateTime.  If I cannot get this to work, it is a showstopper. I've tried numerous variations on the SQL Syntax and cannot get it to work.  I know the error is in the date portion of the WHERE clause since I can remove it and searches work fine. Here is a working query: SELECT Size, Rank, Path, Title, Description, Write, RequestSubmittedDate, DocumentType, RequestPromisedDate, ProblemDescription, DatePublished, RequestOwner, RequestingDepartment, DocumentAuthor, ProjectNumber, ProjectDescription, RequestStatus FROM scope() WHERE CONTAINS ('"nmr"') ORDER BY "Rank" DESC yet if I try to use a date literal in the WHERE clause as in the following query modification, I get the "malformed"

Search query returning 0 results

I'm using a query which returns 0 results but was working some weeks ago.  I checked the code and nothing has changed since then.  I created a Search Center Site on another port and using the same terms I get many results there.  I checked my scopes and they are all right. Nothing changed there either. Could someone help me figure out what may be the problem in my query.  Or maybe it's my Scopes/Content Sources configuration. SELECT URL, FileName, Title, Description, Rank, Size, HitHighlightedSummary, Path FROM SCOPE() WHERE freetext(defaultproperties, ' +légumes')  AND ( "scope" = 'Scope - My Portal - All Site - fr'  )    ORDER BY Rank DESCDaniel Siconnelli There is neither good nor evil... only mogwais and gremlins

How to Perform Query Side Expansion of Synonyms in FAST Search for SharePoint

Hi, I have added Two Way Synonyms in FAST Search Keywords option in Site Settings. If I type the synonym alone, it works but if I type it with some other keyword, the search results in no hits whereas with the Same Keyword if i give the Main Keyword instead of its synonym, the search is successful. I understand that for this we need to do Query Side Expansion of Synonyms. I also tried to Set a Resubmit Flag to AddSynonymsAutomatically but this also failed. Can u pls suggest a way for this?

search on multiple lists

Team, I have a situation where i have to do a search on multiple lists at once. List A - Field A, Field B List A - Field A, Field C List A - Field A, Field D When a user searches by Field A i want to pull all records from all lists. How do i present it after u have done the search. What web parts should i use? Is is possible to search on multiple lists. How to do it through designer? Do i need to a roll up view and search on it. If its possible.. Should i do join of lists and try to filter it based on FIELD A? Can we filter on joined lists? Any ideas on this .... Thanks a lot in advance.      

FASTSearchQueryException encountered when creating FAST Search query scopes in PowerShell

Hi, I made an update to an existing FAST Search query scopes. The updates are on the ExtendedSearchFilter parameter. Since the Set-SPEnterpriseSearchQueryScope PowerShell cmdlet does not work to update the parameter, I removed the existing scopes using Remove-SPEnterpriseSearchQueryScope and created new scopes using the New-SPEnterpriseSearchQueryScope cmdlets. I have noticed that after creating the scopes, I sometimes encounter the "The search request was unable to execute on FAST Search Server" (FASTSearchQueryException) when executing query against the search scope. I am not sure if the exception is related to how the scope objects are disposed after running the Remove-SPEnterpriseSearchQueryScope cmdlet. I tried to look into the Event logs of the FAST search server but I was not able to see the error. I would like to ask the community if the exception can be attributed to the exsiting scopes that were removed then recreated.  Thanks. Jo-an  

How to hide "No results are available. Either no query is specified..." in Core Search Results webpa

Hi All, by default core search results webpart displays this message "No results are available. Either no query is specified, or the query came from advanced search (Federated Webparts do not support Advanced Search queries)." till you perform your first search. So, how can i hide this message when page loaded ? Thanks,

Search Multiple Data Base

Hi,I am working on a Large Database application .  I have 5 Product catalog database   with atleast 5+ million product information on each .  database is deployed in multiple servers. . when the user performs a search it should search in 5 different database and combine the  results to show in the search results.product row has a priority key and based on the priority i need to show the results. In case if same results is found  in all the five  database then we need to group the result and shows the count in result column.For exampleIf Product1  is exist inn all the five database database  then i need to show Product1 - count=5and also we have priority index for showing the result . default search should be sort by priority  .Can any body let me know what will be the best approach to do the search on this multiple  database and  process this data to find the duplicates and sort accurding to the sort index..(we are also planing to restrict the max result from each data base) . Thanks

Search across multiple site collections


I am working on a MOSS 2007 farm and like to know what would be a best way to setup Search so that I can search across multiple Site Collections? Basically, our SharePoint farm use to have only one site collection with lots of subsites. We reorganized and  promoted a lot of those subsites to site collections. After the promotion, I noticed that on each of the new site collection under the search dropdown, the only search scope that was available was “This Site”. I was able to fix this by changing search settings and creating a custom scope by providing the link to the Search Center site that had already existed in the root site collection. However, when I try to search from any site collection using the "All Sites" search scope, no results are displayed and I get a blank page. Any idea what I might be doing wrong? Thanks in advance for your help.

dynamically add coulmn name in sql query for search


i want to add add coulmn name in sql query at run time and if any field is blank or null  than it should not goes with sql query for search ....

column name:




SqlCommand cmd = new SqlCommand("select * from hotelreg where '" + firstName.Text + "' and '" + lastName.Text + "', and '" + address.Text + "' like '%"+textbox1.Text+"%'", con);

plz reply me

Search error-Query component status initialzing


When I try to search anything on my sharepoint site its is showing Internal Server Exception.

When I looked into the Central Administartion->Search Service:Search Administration,the Query Component 0 status is stuck on

initilialzing.So how can I solve this and make the query component 0 online.

Optmization in multiple search scenario


I have a situation where the tables have more than 500 columns and users have privileges to construct dynamic query using an application. 

we need to optimize search in this scenario. I can't create indexes on all columns or even a single index for all columns. also we need to do this with out changing the database schema and application.

Cheers!!! SqlFrenzy
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend