Click here to Skip to main content
15,888,610 members
Home / Discussions / Database
   

Database

 
QuestionDetecting overlapping date ranges - best strategy - help? Pin
Paul Evans1-Aug-04 5:38
Paul Evans1-Aug-04 5:38 
Generalhai Pin
Asha Rams31-Jul-04 22:32
Asha Rams31-Jul-04 22:32 
GeneralBTrieve 6.15 Pin
Mega131-Jul-04 18:05
Mega131-Jul-04 18:05 
GeneralRe: BTrieve 6.15 Pin
Mekong River1-Aug-04 4:07
Mekong River1-Aug-04 4:07 
GeneralSynchronizing tables Pin
winpiglet31-Jul-04 10:43
winpiglet31-Jul-04 10:43 
Questionis there any Win32 function help access SQL server? Pin
fu031-Jul-04 1:47
fu031-Jul-04 1:47 
AnswerRe: is there any Win32 function help access SQL server? Pin
Michael P Butler31-Jul-04 22:14
Michael P Butler31-Jul-04 22:14 
GeneralSP - Efficient "Find" method Pin
UB30-Jul-04 21:58
UB30-Jul-04 21:58 
I want another efficient way to re-write this query.
Note : @empid, @batchid and @name are not always passed to the SP


CREATE PROCEDURE FindEmployee
		@empid          INTEGER         = NULL,
		@batchid        INTEGER         = NULL,	
		@name           VARCHAR(30)     = '%'
AS

	SELECT * FROM Employees
	WHERE  @empid LIKE COALESCE(CONVERT(varchar(3), @empid), '%')
	AND    @batchid LIKE COALESCE(CONVERT(varchar(3), @batchid), '%')
	AND    name LIKE ('%' + @name + '%'


1. If @empid and @batchid were not provided, is there a way to remove thoese columns from the where clause conditionally without writing a seperate query

2. What are the otherways to improve the performance of this kind of a query



Thanks





UB

You may stop this individual, but you can't stop us all... after all, we're all alike. +++Mentor+++
GeneralRe: SP - Efficient "Find" method Pin
Daniel Turini31-Jul-04 11:05
Daniel Turini31-Jul-04 11:05 
GeneralSQL query to generate random numbers Pin
Imtiaz Murtaza29-Jul-04 23:45
Imtiaz Murtaza29-Jul-04 23:45 
GeneralRe: SQL query to generate random numbers Pin
Steven Campbell30-Jul-04 7:55
Steven Campbell30-Jul-04 7:55 
GeneralRe: SQL query to generate random numbers Pin
Grimolfr30-Jul-04 8:22
Grimolfr30-Jul-04 8:22 
GeneralBeginner - OLE DB - bind IRowSet to grid control Pin
poptcat29-Jul-04 21:46
poptcat29-Jul-04 21:46 
GeneralRelation between tables Pin
RoyRose7829-Jul-04 20:17
RoyRose7829-Jul-04 20:17 
GeneralRelation between tables Pin
Sendilkumar.M30-Jul-04 19:13
Sendilkumar.M30-Jul-04 19:13 
GeneralRe: Relation between tables Pin
RoyRose7830-Jul-04 22:15
RoyRose7830-Jul-04 22:15 
GeneralPlease recommend on connection to Ms Acess Database Pin
DotNet29-Jul-04 15:16
DotNet29-Jul-04 15:16 
GeneralRe: Please recommend on connection to Ms Acess Database Pin
EdbertP29-Jul-04 16:52
EdbertP29-Jul-04 16:52 
GeneralUser access to SQL Server database Pin
Colin Angus Mackay29-Jul-04 6:35
Colin Angus Mackay29-Jul-04 6:35 
GeneralRe: User access to SQL Server database Pin
Grimolfr29-Jul-04 7:56
Grimolfr29-Jul-04 7:56 
GeneralRe: User access to SQL Server database Pin
Colin Angus Mackay29-Jul-04 22:37
Colin Angus Mackay29-Jul-04 22:37 
QuestionODBC API's code examples? Pin
PrashantJ28-Jul-04 21:54
PrashantJ28-Jul-04 21:54 
Generalxml to excel Help! Pin
michanne128-Jul-04 12:07
michanne128-Jul-04 12:07 
GeneralCreate System Database form C# using ADOX Pin
ulrich_v28-Jul-04 0:37
ulrich_v28-Jul-04 0:37 
GeneralNeed help!!! Pin
yanh10027-Jul-04 14:12
yanh10027-Jul-04 14:12 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.