Click here to Skip to main content
16,004,860 members
Home / Discussions / Database
   

Database

 
QuestionADO recordset.open connection.execute concurrent problem Pin
followait23-Sep-08 3:57
followait23-Sep-08 3:57 
AnswerRe: ADO recordset.open connection.execute concurrent problem Pin
Ashfield23-Sep-08 5:00
Ashfield23-Sep-08 5:00 
QuestionDefault date format Pin
mikobi23-Sep-08 3:23
mikobi23-Sep-08 3:23 
AnswerRe: Default date format Pin
NeverHeardOfMe23-Sep-08 3:59
NeverHeardOfMe23-Sep-08 3:59 
QuestionHow to perform a search in a table with given more than one paramaters (SQL SERVER EXPRESS 2008)? Pin
JUNEYT23-Sep-08 1:54
JUNEYT23-Sep-08 1:54 
AnswerRe: How to perform a search in a table with given more than one paramaters (SQL SERVER EXPRESS 2008)? Pin
Ashfield23-Sep-08 4:58
Ashfield23-Sep-08 4:58 
AnswerRe: How to perform a search in a table with given more than one paramaters (SQL SERVER EXPRESS 2008)? Pin
nelsonpaixao23-Sep-08 13:13
nelsonpaixao23-Sep-08 13:13 
AnswerRe: How to perform a search in a table with given more than one paramaters (SQL SERVER EXPRESS 2008)? Pin
Kevin Horgan23-Oct-08 9:53
Kevin Horgan23-Oct-08 9:53 
Hi
I guess you could try something like this.

CREATE PROCEDURE client_stuff
@variable1 int = NULL,
@variable2 varchar(10) = NULL,
@variable3 double = NULL

AS

SELECT * FROM mytable t1
WHERE client_id = ISNULL(@variable1,t1.client_id)
AND client_name = ISNULL(@variable2, t1.client_name)
AND client_balance = ISNULL(@variable3, t1.client_balance)

... etc

I hope that is the right syntax for your DB. Basically you pass in NULLABLE parameters which may or may not be specified, then in the select use ISNULL to replace any NULL values with the value in the column, so if NULL then give me everything in this column, otherwise give me only records whose value in the column match the parameter.

I hope that helps,

Cheers,

Kevin
Questionarray of string in procedure Pin
Shaista Shafiq23-Sep-08 0:59
Shaista Shafiq23-Sep-08 0:59 
AnswerRe: array of string in procedure Pin
Ashfield23-Sep-08 1:21
Ashfield23-Sep-08 1:21 
Questionhug database Pin
mahmoudinirat23-Sep-08 0:39
mahmoudinirat23-Sep-08 0:39 
AnswerRe: hug database Pin
ChandraRam23-Sep-08 1:06
ChandraRam23-Sep-08 1:06 
AnswerRe: hug database Pin
Ashfield23-Sep-08 1:22
Ashfield23-Sep-08 1:22 
QuestionRe: hug database Pin
nelsonpaixao23-Sep-08 14:49
nelsonpaixao23-Sep-08 14:49 
QuestionMemory Occupied by a table of a database Pin
sailesh_gupta22-Sep-08 20:02
sailesh_gupta22-Sep-08 20:02 
AnswerRe: Memory Occupied by a table of a database Pin
N a v a n e e t h22-Sep-08 20:12
N a v a n e e t h22-Sep-08 20:12 
QuestionHow to find the latest Pin
krishnan.s22-Sep-08 19:27
krishnan.s22-Sep-08 19:27 
AnswerRe: How to find the latest Pin
Ashfield22-Sep-08 21:24
Ashfield22-Sep-08 21:24 
GeneralRe: How to find the latest Pin
krishnan.s22-Sep-08 21:46
krishnan.s22-Sep-08 21:46 
GeneralRe: How to find the latest Pin
Ashfield23-Sep-08 1:19
Ashfield23-Sep-08 1:19 
AnswerRe: How to find the latest Pin
Wendelius23-Sep-08 8:11
mentorWendelius23-Sep-08 8:11 
GeneralRe: How to find the latest Pin
nelsonpaixao23-Sep-08 13:34
nelsonpaixao23-Sep-08 13:34 
AnswerRe: How to find the latest Pin
shiva.kore6-Sep-10 21:58
shiva.kore6-Sep-10 21:58 
QuestionTo Compare identical tables Pin
krishnan.s22-Sep-08 19:02
krishnan.s22-Sep-08 19:02 
AnswerRe: To Compare identical tables Pin
Wendelius23-Sep-08 7:54
mentorWendelius23-Sep-08 7:54 

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.