How To Search A Database For A Key Word Based Search?
Can anyone tell me how to search an SQL database for a given key word in a textbox? I basically have a database that has a qualifications column and this column needs to be searched for the data given in the textbox. Which is the best method to search for the data? Is it a simple SQL query or an XML based search engine type?
Can anyone give any suggestions regarding this? If XML is efficient then how do I use it to query my database, as I'm pretty new in XML based searching.
Thanks
View Complete Forum Thread with Replies
Related Forum Messages:
Search A Word In Database
Hi I was wondering if anyone can help me out here. I want to search a word in the database which has more than 80 tables is it possible to search all the tables at once for that word. I am using SQL2005. Thanks in advance.
View Replies !
How Do You Create A Multiple Word Search Box To Return Rows From A Sql Database In Asp.net 2.0
I am using VS2005 to construct a website. I have a sql database with 3 datasets. One of the table adapters is called Proudcts and has the following fields. ProductItem, Description, Price, ProductID, PackSizeI want to be able to see a summary of the products (there are thousands of them) using one or more words (or partial words) in one text box to search in only 3 fields (ProductItem, Description, ProductID, ). This needs to show only records which contain the search criteria in a gridview?This is such a basic requirement for a website, and can be found on many sites, but I haven't found how to do it.Thanks, Bri
View Replies !
Sql Search Command Word By Word?
hi! I'm just wondering does anyone know how to create an sql command that can search word by word? what i mean is like I have a product with name 'harry potter broom'. I want an sql command where if i type only 'harry broom' this 'harry potter broom' product will show up. Does anyone have any idea? Here's my sql comand: (I'm using asp.net vb script do develop this system) ------------------------------------------------------------------------- query = "select distinct * from product where " & _ "(pname like '%" & keyword & "%' or " & _ "pdesc like '%" & keyword & "%' ) and " & _ "(price >= " & price1 & " and price <= " & price2 & _ ") and status <> 'out of stock' order by price asc" ------------------------------------------------------------------------- Thank you.
View Replies !
SQL 2000 MS Search: Boolean Search Doesn't Work When Search By Phrase
I'm just wonder if this is a bug in MS Search or am I doing something wrong. I have a query below declare @search_clause varchar(255) set @Search_Clause = ' "hepatitis b" and "hepatocellular carcinoma"' select * from results where contains(finding,@search_clause) I don't get the correct result at all. If I change my search_clause to "hepatitis" and "hepatocellular carcinoma -- without the "b" then i get the correct result. It seems MS Search doesn't like the phrase contain one letter or some sort or is it a know bug? Anyone know? Thanks
View Replies !
How To Do A Word Search?
I need to be able to search article in several tables in a MSSQL DB. What is the best way to do a word search? Are there and freebies out there or code examples? Dave
View Replies !
Search Within Word Document
Hi ,I would like to whether its possible or not.I have stored word document(Resume) in SQL server. Now i want to search for particular key word.for example . I want to list down all details of candidate which have ASP.Net mentioned in their resume. So please provide me any link / or article .
View Replies !
Multi Word Search
I'm working on a staff directory and want to be able to search across multiple fields. I have columns named FullName Forename Surname and aka_Forename I'd like people to get a result if they, for example type in "David Smith" or "Dave Smith" with "Smith" being the surname "David Smith" being the FullName, "David" the forename and "Dave" the aka_Forename. Any idea how to make an SQL query to do this. Ideally as a stored procedure.
View Replies !
Multi Word Search
Hi, I am trying to search a multi words with “like� function using the following statement in a S.P.: @ITEM_desc nvarchar(10), @QUOTFIL nvarchar (200), @mfil nvarchar (500) = '' SET @mfil = QUOTENAME('%' + @ITEM_desc + '%','''') exec ('select * from ims.item where adesc like' + @mfil + @QUOTFIL) Nrormaly one word can be send to SP for searching, is there any way to send multi word for the like function to search Like follows: '%LOCAL%,%LIGHTS%' Best regards
View Replies !
How To Search Text In A Word Document ?
I'm designing a Job Recruitment Website, in which the admin person searches for the right candidate for the job using certain keywords . Each jobseeker will be uploading his CV (ms word doc) during registration .How can i search for keywords in the word documents. I just want the candidate reference once i found keyword match in the word docs.I heard about the indexing and blobs in sql server? But dont know much about it Are these the only solutions ?Is there any better approach for this ?Any help will be greatly appreciated
View Replies !
Criteria; Search Any Word In Field
I am trying to set up a query that will allow the user to input a string, and the search will match ANY word in that string. Currently, I have it configured so that the search will only match the exact string that the user inputs. I have google searched for the answer, but no luck yet. Any ideas?
View Replies !
Full Text Search (more Than One Word
I am trying to use the Full Text Search of SQL Server with my web site to search records in my database for keyworkds. I had built the search catalogs and everything looks fine. The problem I am having is, when you search into our web site with a single keyword, everything goes fine and search results are coming back as expected which is awesome. When you put more than one word like "cybex switch" or "cybex and switch" or "cybex or switch" it will not return any results and some time it might error. I have tried putting the sql string seperate (without web page) into the query tool and it didnt return any records and some time error. Anybody who did that before, I am sure thier is away to do it because Microsoft use it and others does too. As everybody else we use Active Server Pages PS. you can visit our web site at http://www.kvms.com to check it out Thanks for the help. David Farah david@petra.net http://www.kvms.com
View Replies !
Find Exact Word In Full-Text Search
Hi, I have the fields like this. Session1 Session2 Session3 Session4----------------------------------------------------------------------------------------- SQL Server-Part1 SQL Server-Part2 ASP.Net CSS C# SQL Server-Part3 ASP.Net Javascript I have set the Full-Text to all the columns. For searching i wrote the below query SELECT * FROM <TABLE NAME> WHERE CONTAINS(*,'"SQL Server-Part1"') My Result expectation is: The First Record should come. But the result of the query bring the two records. It see the "SQL Server" string also. I need to find the exact word. How to do it? Please answer me as soon as possible. Ganesh.
View Replies !
Search Based On User Input
I have a search page that allows users to type/select values contined within the entry they're looking for. My SELECT statement returns columns in a table that get compared to the user input. So if someone selected Status (Open) then all of the 'Open' Request entries should populate the search page. How do I phrase the SELECT statement to compare values if the user gives them, but ignore the fields where no data was input when it's searching? So a search where no values were entered would return every Request Entry instead of an error; no entry. Thanks!
View Replies !
What Is The Best Way To Build The Search Based On Form Fields
I required to build the search feature for my application which contains combination of at least 20 search fields e.g firstname, lastname. date of birth, sign up date ,etc... I am just wondering what is the best way to do it ,should I create stored procedure with 20 input parameters or should I build it based on each search fields. I need to provide the search results via web services. Could anyone help me? Thank you
View Replies !
Help W/ Stored Procedure? - Full-text Search: Search Query Of Normalized Data
Hi - I'm short of SQL experience and hacking my way through creating a simple search feature for a personal project. I would be very grateful if anyone could help me out with writing a stored procedure. Problem: I have two tables with three columns indexed for full-text search. So far I have been able to successfully execute the following query returning matching row ids: dbo.Search_Articles @searchText varchar(150) AS SELECT ArticleID FROM articles WHERE CONTAINS(Description, @searchText) OR CONTAINS(Title, @searchText) UNION SELECT ArticleID FROM article_pages WHERE CONTAINS(Text, @searchText); RETURN This returns the ArticleID for any articles or article_pages records where there is a text match. I ultimately need the stored procedure to return all columns from the articles table for matches and not just the StoryID. Seems like maybe I should try using some kind of JOIN on the result of the UNION above and the articles table? But I have so far been unable to figure out how to do this as I can't seem to declare a name for the result table of the UNION above. Perhaps there is another more eloquent solution? Thanks! Peter
View Replies !
Save Indexed Search Words (Index Full-text Search)
We have SQL Sever 2005 and created a Full-text Search on a one of our main tables. When some one comes for the first time and searches for "carb" it takes a long time to return results, but when the same search is done within a few more minutes, results return in less than 1 second. Is there a setting in SQL Server 2005 to save all the indexes of searched words? Thanks
View Replies !
Search The Table Based On A Substring (was: Newbie Question)
Hello everyone, Just getting started with MS SQL. I have the following question: I have a table with one field being a string (it is also an index field). I want to search the table based on a substring. For instance: if a Field in any record has a value of '1.2.3.4.5.6' and I search for '1.2.3.' I want to get that record How? Thanks, Avi.
View Replies !
Full-Text Search: Prefix / Suffix Search
Please help me to create an SQL Server 2000 Stored Procedure for using prefix and suffix terms. Example: Say I want to find "Terminator" (1984). I want to be able to use "Term" or "ator" as search results and still return the proper record. Here is my Stored Procedure creation sql: CREATE PROCEDURE sps_searchTitles(@searchTerm varchar(255)) AS SELECT * FROM Video WHERE FREETEXT (Video.*, '"*@searchTerm*"') GO --- The above does not appear to properly check both prefix ("Term---") and suffix ("---ator") terms. I am trying to accomplish what is similarly done with LIKE '%term%'. thanks, YM
View Replies !
Full Text Search- Substring Search Not Working
I have Sql server 2005 SP2. I enabled it for Full Text search. Substring search where i enter *word* doesn't return any row. I have a table testtable where description has word Extinguisher. If i run a query with *ting* it doesn't return any row. select * from testtable where contains(description,'"*xting*"') ; But it works if i do select * from testtable where contains(description,'"Exting*"') ; The Full text search document says it supports substring search. Is it an issue with sql server 2005?Please help.
View Replies !
Word &&"search&&" In String
Hi All, Please help, it is urgent I am having a colume as image datatype, in which candidates resume is stored in binary format. I have to search for particular words for eg. "ASP.Net, 2 Years" into that column I have converted that column as varchar and then searching above two words(after spliting them by comma) into that string using CHARINDEX DECLARE @i int, @j int SET @i = select MIN(ResumeId) from table_name SET @j = select MAX(ResumeId) from table_name WHILE (@i <= @j) BEGIN DECLARE @Resume varchar(max) SET @Resume = CAST((select Resume from table_name where ResumeId=100) as varbinary(max)) --code to search the particular word from @Resume END It is working fine, but it is very slow, taking 2+ minutes to scan 15000 records How can I make it faster or is there any other way to search? Thanks in advance
View Replies !
Full Text Search Vs LIKE Search
Are there any big differences between the two search techniques? It seems like they are both very similar. SELECT * FROM TABLE1 WHERE TEXTFIELD1 LIKE '%DATABASES%' SELECT * FROM TABLE1 WHERE CONTAINS (TEXTFIELD1 ,' "DATABASES" ')
View Replies !
Create Site Search Using Sql Server &"full Text Search&"
would you use sql server "full text search" feature as your site index? from some reason i can't make index server my site search catalog, and i wonder if the full text is the solution. i think that i wll have to you create new table called some thing like "site text" and i will need to write every text twice- one the the table (let's say "articles table") and one to the text. other wise- there is problems finding the right urlof the text, searching different tables with different columns name and so on... so i thought create site search table, with the columns: id, text, url and to write every thing to this table. but some how ot look the wrong way, that every forum post, every article, album picture or joke will insert twice to the sqr server... what do you think?
View Replies !
Database Search
Hi I would like to know whether any tools are there to search in a database. Ex. i am using sql server2005 and in my db, more than 1000 tables r there. i want to search for a perticular column. This search should be on tables, sps, functions, triggers.....etc. If anybody aware of any tool for this or any code in dotnet to develop such tool, pls let me know. Regards Sanjay
View Replies !
Search Database
I design table which has column "keywords" for keep keywords seperated by comma (,). If user pass one keyword, how can I know that the keyword user select is exactly match with any keyword in field. I mean I just want SQL return only rows that user's keyword is exactly match with at least one keyword in "keywords" column. Ex. PK1 Data1 Data2 keywords 1 1 1 apple, orange 2 2 2 mange, orange 3 3 3 mange, apple If user select keyword 'orange', SQL must return only row 1 and 2.
View Replies !
Sql Database Search
Does anyone know of a software product that can search through a large Network Enterprise, searching for all SQL databases while, specifying an IP range?
View Replies !
How Search A Value In A DataBase.
--Author:=> Kapil Choudhary Jaipur (India) --Motive:- Search A Text value In A DataBase With The Table Name. create procedure [search_value] @fstr nvarchar(128) with encryption as set nocount on declare @rc int --Counter Variable For The Cursor 1. declare @rcc int --Counter Variable For The Cursor 2. declare @tc nvarchar(128)--TABLE_CATALOG. declare @ts nvarchar(128)--TABLE_SCHEMA. declare @tn nvarchar(128)--TABLE_NAME. declare @tt nvarchar(128)--TABLE_TYPE. declare @Ctn nvarchar(128)--Column Table Name. declare @Cts nvarchar(128)--Column Table Schema. declare @Ccn nvarchar(128)--Column Column Name. declare @Cdt nvarchar(128)--Column Data Type. declare @currow1 int--Total Row Count For The Cursor 1. declare @currow2 int--Total Row Count For The Cursor 2. declare @str nvarchar(128) --Dynamically Created Query String. declare @strresult nvarchar(128)--Value Stored From Temp Table. declare @findwhat nvarchar(128) -- String To Be Searched. set @rc=1 create table #temp (colval nvarchar(128)) create table #myresult(Table_Name nvarchar(128),Column_Name nvarchar(128),Column_Value nvarchar(128)) declare mycur1 cursor static for select TABLE_CATALOG,TABLE_SCHEMA ,TABLE_NAME,TABLE_TYPE from INFORMATION_SCHEMA.TABLES where TABLE_TYPE='BASE TABLE' open mycur1 set @currow1=@@cursor_rows --print 'table rows = '+str(@currow1) while @rc<=@currow1 begin fetch next from mycur1 into @tc,@ts,@tn,@tt declare mycolcur cursor static for select TABLE_SCHEMA,TABLE_NAME,COLUMN_NAME,DATA_TYPE from information_schema.columns where TABLE_CATALOG=@tc and TABLE_SCHEMA=@ts and TABLE_NAME=@tn and data_type in('char','varchar','nchar','nvarchar') open mycolcur set @findwhat='wa'--Your Search Value Here set @rcc=1 set @currow2=@@cursor_rows --print 'table col = '+str(@currow2) --print 'Table name'+' '+'owener'+' '+'Column Name' --print '-----------------------------------------------' while @rcc<=@currow2 begin fetch next from mycolcur into @Cts,@Ctn,@Ccn,@Cdt -- print @ctn+' '+@cts+' '+@ccn set @rcc=@rcc+1 set @str='select '+quotename(@ccn) + ' from ' +quotename(@cts)+'.'+ quotename(@ctn) + ' where ' + quotename(@ccn) +' like '+char(39)+@findwhat+char(39) set @str='insert into #temp(colval) '+@str --print @str exec (@str) if exists(select * from #temp) begin select @strresult= colval from #temp --print 'colval =========>>>>> ' + @strresult delete from #temp insert into #myresult(Table_Name,Column_Name,Column_Value) values(@ctn,@ccn,@strresult) end end close mycolcur deallocate mycolcur set @rc=@rc+1 end --print @@cursor_rows select * from #myresult close mycur1 deallocate mycur1 drop table #temp drop table #myresult set nocount off Go
View Replies !
Search For Tables In Database
well i am using vb.net and would like to know how to search a specific table in the databasefor egif table1 exists in database then drop table1end if ...something like that
View Replies !
How To Search Record In Database By Using ASP.NET
I have problem in searching record using ASP.Net: Here is the error: The column prefix 'txtID' does not match with a table name or alias name used in the query Here is the code: <%@ page language = "vb" runat = "server"%><%@ Import Namespace = "System.Data"%><%@ Import Namespace = "System.Data.SqlClient"%><script runat = "server"> Sub SearchData(sender As Object, e As EventArgs)dim StudentConnection as SqlConnectiondim StudentCommand as SqlCommanddim StudentReader as SqlDataReaderdim i as Integer = 1 StudentConnection = New SqlConnection("Server=MYCOMP;uid=tim;pwd=tim;database=Student")StudentConnection.Open() StudentCommand = New SqlCommand("Select * From Student_Table Where STUDID = txtID.text",StudentConnection)StudentReader = StudentCommand.ExecuteReader()StudentDataGrid.DataSource = StudentReaderDataBind() StudentReader.Close()StudentConnection.Close() End Sub</script> <html><head><title>::SAG Computer School::</title></head><body><form runat = "server">Student ID : <asp:TextBox id = "txtID" runat = "server" /><asp:Button id = "btnSearch" text = "Search" runat = "server" OnClick = "SearchData" /> <asp:DataGrid id = "StudentDataGrid" BorderColor = "Black" BorderWidth = "1" CellPadding = 3 CellSpacing = 0Font-Name = "Arial" Font-Size = 10pt Font-Color = "Black" AutoGenerateColumns= false ItemStyle-BackColor = "White" HeaderStyle-BackColor = "#FFEFD5"ItemStyle-Font-Size = 8pt runat = "server"></asp:DataGrid> <Columns><asp:boundcolumn HeaderText = "ID" DataField = "STUDID" /><asp:boundcolumn HeaderText = "NAME" DataField = "STUDNAME"/><asp:boundcolumn HeaderText = "ADDRESS" DataField = "ADDRESS" /><asp:boundcolumn HeaderText = "IC NO" DataField = "ICNO" /><asp:boundcolumn HeaderText = "PHONE" DataField = "PHONE" /><asp:boundcolumn HeaderText = "EMAIL" DataField = "EMAIL" /><asp:boundcolumn HeaderText = "DATE OF BIRTH" DataField = "DOB" /><asp:boundcolumn HeaderText = "NATIONALITY" DataField = "NATIONALITY" /><asp:boundcolumn HeaderText = "COURSE" DataField = "COURSE" /></Columns></form></body></html> Anyone know the solutions??? Or, is this a correct way in searching data?? Thanks, Suigion
View Replies !
Can Anyone Help Me With Connecting To A Database To Search?
I'm trying to make this piece of code work, I get all of it except how I get the data from the database, what I wish to do is. On page load I wish to take the value of a querystring in the page URL called ProductID and search a database to see if it exists in a specifical table and column, if it exists I wish to make a button not visible. the code I am using is: ############# protected void Page_Load(object sender, EventArgs e) { // Get the querystring value String inQueryString = Request.QueryString["ProductID"]; // Get the data from the database, using the above value DataTable data = ?? The datasource I want to connect to is SqlDataSource1, and the table I want to search is “Reviews�. I want to search in the column “ProductID� and search for the ProductID from the URL query string above. // Did we find a product in the database? if (data != null && data.Rows.count > 0) { // Code to display the product's information // We found a product, so we need to hide a button Button5.Visible = false; } } ########################## Please can somebody fill in the missing bit for me so i know how it should be, i've searched the quickstart tutorial on the menu above and I still don't understand it, as it doesn't show anything like what I want to do, and I have looked at numerous websites about the matter. If you don't have time that is okay, but If somebody does have the time to show me what I need, I would be very greatfull. Regards Daniel coates
View Replies !
Using Webforms To Search A Database
Currently, I am working on a website that will use a webform to search a SQL database and list the results in a datalist. I have the database set up with four tables. The form will have choices in each of the tables for users to choose from. The problem I am having where to even start with the code to make this possible. I have the cosmetic part of it set up already. I appreciate any help I can get on this.
View Replies !
How Search PDF File In The SQL Database ?
Hi guys, Now I upload the PDF file and store it in the database as binary. But now I need to search the text in the PDF file. Is there any way I can search the content in the database ? Anyone has any idea about it ?Thanks!Regards,Sam
View Replies !
Search Text In Database
Hi,I would like to use keywords inside a record to search for - like asearchengine.How can I design the table? Right now I would store data in Memo-Column in aformat like ";apple;banana;lemon;". I would use a INSTR(ring)-function - butI wonder if the performance is still OK then - even when I index the field.Are there maybe even better ways?Thanx in advance.Greg
View Replies !
Database Search Engine
Hi folks, Whts up........??? M back, after a long gap. I have come across with a major issue. And u know wht th issue is.........??? It is about th DATABASE SEARCH TOOL. I have a database of around 30 tables. Now I wud like to have aa search engine on my .asp page. There will be a text box on th page and one submit button. After typing some text in th text area n submitting th page, my package sud check tht perticular text in all th COLUMNS of all th TABLES, n whrevr it gets a match (exactly same, or by speech recognition), it sud through th links on th next page. Nw i wud like u guys to take this problem, at th earliest n come up with a up to th mark solution. Thnkx
View Replies !
Search Database For [expression]
Yep, I know this will have been asked before (because I've seen it), but I can't for the life of me find a thread! So I've inherited this database and I need to search the whole darn thing for a single word, returning something lovely, like the table or column the thing resides in. Basically it's a code in one of 100+ code tables, all with inconsistant, unclear naming - YAY! FYI, I'm using SQL Server 200 and the word I'm looking for is "Unpaid". Thanks guys, girls and gurus
View Replies !
Search A String Throughout The Database
Hello I have a Database which contains like 1000 Tables. I am not the designer of that DB.So I need to in which table and which column that string exists. IS there a DBWIDE String search possible? Thanks and Regards
View Replies !
Dropdownlist Database Search
Hi all. I have a huge problem that ive been sitting with for awhile. I have a web page with 4 dropdownlist boxes on it Gender: Race: Field: Location: Now a user can search a SQL db from selecting values from these 4 dropdownlist boxes which are equal to values in the db obviously. when they have done that and pressed submit a Gridview is populated with the people corresponding details and the user is able to view each row seperately. Now the problem i am having is that when i havent used all 4 selections for eg Gender: null (no value selected) Race: Black Field: Accounting Location: Los Angeles then no information is returned from the db in the gridview. im using a sqldatasource to populate the gridview and here is the query string that i am using : Code: sql SELECT [title], [gender], [initials], [name], [surname], [birthdate], [postaladdress], [suburb], [city], [zipcode], [criminalrecord], [drivers], [maritalstatus], [dependants], [citizenship], [province], [contactref], [hometel], [cell], [jobtitle], [relocate], [emmigrate], [email], [worktel], [enddate], [startdate], [FIELD], [education], [company], [positionheld], [jobdescription], [contactperson], [contacttel], [startdate2], [contactperson3], [jobdescription3], [positionheld3], [company3], [enddate3], [startdate3], [contacttel3], [other] FROM [cvinformation] WHERE (([race] = CASE WHEN @race IS NOT NULL THEN @race ELSE [race] END) AND ([province] = CASE WHEN @province IS NOT NULL THEN @province ELSE [province] END) AND ([education] = CASE WHEN @education IS NOT NULL THEN @education ELSE [education] END)) what i want to do is whether the user doesnt choose any selection and leaves the choice null that ALL the information in the table of the db be shown and even if they only choose 2 values and leave the others null then it still brings back the information from the criteria chosen.. Is this possible.?
View Replies !
Search For Keyword In Database
Hii I want to search for a keyword in the database. The database has approximately 30 tables and the amount of data in tables is very large. Most of the tables hold 25000 rows. The search procedure for searching a keyword that i want to use is as below. When i executed the stored proc it took 20 minutes. What i want to know is full-text search a better option than this or is there any other way out. CREATE PROC SearchAllTables ( @SearchStr nvarchar(100) ) AS BEGIN CREATE TABLE #Results (ColumnName nvarchar(370), ColumnValue nvarchar(3630)) SET NOCOUNT ON DECLARE @TableName nvarchar(256), @ColumnName nvarchar(128), @SearchStr2 nvarchar(110) SET @TableName = '' SET @SearchStr2 = QUOTENAME('%' + @SearchStr + '%','''') WHILE @TableName IS NOT NULL BEGIN SET @ColumnName = '' SET @TableName = ( SELECT MIN(QUOTENAME(TABLE_SCHEMA) + '.' + QUOTENAME(TABLE_NAME)) FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE = 'BASE TABLE' AND QUOTENAME(TABLE_SCHEMA) + '.' + QUOTENAME(TABLE_NAME) > @TableName AND OBJECTPROPERTY( OBJECT_ID( QUOTENAME(TABLE_SCHEMA) + '.' + QUOTENAME(TABLE_NAME) ), 'IsMSShipped' ) = 0 ) WHILE (@TableName IS NOT NULL) AND (@ColumnName IS NOT NULL) BEGIN SET @ColumnName = ( SELECT MIN(QUOTENAME(COLUMN_NAME)) FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_SCHEMA = PARSENAME(@TableName, 2) AND TABLE_NAME = PARSENAME(@TableName, 1) AND DATA_TYPE IN ('char', 'varchar', 'nchar', 'nvarchar') AND QUOTENAME(COLUMN_NAME) > @ColumnName ) IF @ColumnName IS NOT NULL BEGIN INSERT INTO #Results EXEC ( 'SELECT ''' + @TableName + '.' + @ColumnName + ''', LEFT(' + @ColumnName + ', 3630) FROM ' + @TableName + ' (NOLOCK) ' + ' WHERE ' + @ColumnName + ' LIKE ' + @SearchStr2 ) END END END SELECT ColumnName, ColumnValue FROM #Results END EXEC SearchAllTables 'FileName'
View Replies !
How To Search A Database By Paramaters
Hi, Does anyone know how i go about writing a search query using paramaters, ive been using this as my template: Select Distinct Recipedata.Name, Ingredients.Ingredient, Directions.Directions from Recipedata,Ingredients,Directions Where Ingredients.Ingredient Like '%Chicken%' and RecipeData.RecipeID = Ingredients.RecipeID and Ingredients.RecipeID = Directions.RecipeID; Problem is now that i want to use paramters instead of hard coded values as this is for a user. How do i go about this? This database has a VB2k5 front end for the desktop and PDA(and no the target PDA is not web enabled so web servcies arent available to me). Thanks Much
View Replies !
|