Prepare for your Next Interview
|
Welcome to the Geeks Talk forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact contact us. |
This is a discussion on how to write search condition in sql server within the SQL Server forums, part of the Databases category; Hi friend, I have written a query in oralce for searching ...for example in matrimonial site searching a a bride or groom based on seelct value...now i required to change ...
|
|||||||
| SQL Server SQL Server is a Database Management System(DBMS) by Microsoft |
![]() |
| LinkBack | Thread Tools | Display Modes |
|
|||
|
how to write search condition in sql server
Hi friend,
I have written a query in oralce for searching ...for example in matrimonial site searching a a bride or groom based on seelct value...now i required to change the query in sql server...can anybody help... the code i have written in oracle procedure Get_viewOrders(reqno in varchar2,reqdate in varchar2,employeename in varchar2) As v_qry varchar2(10000); begin v_qry:='select tr.requestno,us.firstname||' ' ' '||,tr.status from travelorders tr,users us where lower(us.id)=lower(tr.id)' if reqno is not null then v_qry:=v_qry || 'and tr.requestno=upper(' ' ' || reqno || ' ' ')' end if; if requestdate is not null then v_qry:=v_qry || 'and to_date(tr.requestdate,' 'dd\mm\yyyy' ')=to_date(' ' ' ||reqdate|| ' ' ',' ' dd/mm/yyyy' ')' end if end Get_viewOrders thanks shree Last edited by shree2312; 06-14-2009 at 04:37 AM. |
| Sponsored Links |
|
|||
|
Re: how to write search condition in sql server
and i tried to write the query as shown below
ALTER procedure [dbo].[search_Improved](@firstname varchar(50)=null) AS BEGIN declare @sql nvarchar(4000) select @sql='select *from EmpDetails where 1=1' if @firstname is not null select @sql=@sql+' and fname=@firstname' END it returns 0... didnt find the solution |
![]() |
|
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Read and write images in vb.net from a database using SQL Server | solvequeries | VB.NET | 2 | 06-20-2009 04:31 AM |
| What is the race condition? | ABSMITH | OOPS | 5 | 10-16-2008 10:10 AM |
| Where Condition | krishnaindia2007 | Oracle | 3 | 11-30-2007 01:54 AM |
| Using LIKE operator in multiple condition | Sant_parkash | SQL | 4 | 11-29-2007 02:47 AM |
| Test Condition | reks_209 | Testing Templates | 3 | 09-14-2007 04:18 AM |