Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
mahimam_2004
Starting Member
40 Posts |
Posted - 2008-07-06 : 12:41:54
|
| Hi, I have a table tblbusiness like this: ID | Business Name | 1 | xxx LLC2 | ff LLP Like the above table, I have multiple tables to store Manufacturer(id, name) , Distributor(id, name), LicenseNo( id, Number), Person (id, name).. Now from the website user has to perform the search for the above fields. To do this, in the web site, I amputtingdropdown list1 : (operator) valueName: business name LIKE ffManufacturer name NOTPerson name ... Not Like Now th stored procedure got the parameters: columnname: frist dropdownlist value, which is the table's column. second parameter is for operator which is used in Where clause. and third parameter is value. Based upon teh selection of first drop down list value, i have to get the table name before performing the query(Ex: if columnname value is businessname, table is tblbusiness).Do the search like this:if(columnname like 'businessname') tbl = 'tblBusienss'else if(columnname like 'personname') tbl = 'tblPerson' Select * from tbl where 'columnname' 'pOperator' 'pvalue' ;How to perform the above query?Thanks in advance |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
|
|
|
|
|
|
|