Click here to Skip to main content
15,894,291 members
Home / Discussions / Database
   

Database

 
QuestionSQL Join Pin
Dayekh24-Jan-07 1:51
Dayekh24-Jan-07 1:51 
AnswerRe: SQL Join Pin
Pete O'Hanlon24-Jan-07 2:04
mvePete O'Hanlon24-Jan-07 2:04 
GeneralRe: SQL Join Pin
Dayekh24-Jan-07 2:16
Dayekh24-Jan-07 2:16 
GeneralRe: SQL Join Pin
Dayekh24-Jan-07 2:26
Dayekh24-Jan-07 2:26 
QuestionVariable with multiple values? Pin
caliguloo24-Jan-07 0:24
caliguloo24-Jan-07 0:24 
AnswerRe: Variable with multiple values? Pin
andyharman24-Jan-07 0:33
professionalandyharman24-Jan-07 0:33 
AnswerRe: Variable with multiple values? Pin
caliguloo24-Jan-07 1:40
caliguloo24-Jan-07 1:40 
AnswerRe: Variable with multiple values? Pin
Michael Potter24-Jan-07 5:26
Michael Potter24-Jan-07 5:26 
@test is a variable replaced at query execution. Using your 'expanded' example, the resultant query would be looking for all rows where ID = "('ID1','ID2','ID3')". The IN would result to equal because there is only one element in the clause (@test).

SQL variables can only replace one element, not a list of more than one. You can get around this with dynamic SQL generation which uses your variable to build a new SQL string but, you indicate you don't want to use a Stored Proc.

Solution: Drop the variable and rewrite your code to build the full statement with a comma deliminated IN clause.
GeneralRe: Variable with multiple values? Pin
caliguloo24-Jan-07 21:11
caliguloo24-Jan-07 21:11 
AnswerRe: Variable with multiple values? Pin
M.H.1.2.325-Jan-07 20:17
M.H.1.2.325-Jan-07 20:17 
QuestionMinimizing returned records from DB Pin
MayyMagdy23-Jan-07 23:11
MayyMagdy23-Jan-07 23:11 
AnswerRe: Minimizing returned records from DB Pin
andyharman24-Jan-07 2:15
professionalandyharman24-Jan-07 2:15 
QuestionTEXT datatype Pin
quiteSmart23-Jan-07 22:29
quiteSmart23-Jan-07 22:29 
AnswerRe: TEXT datatype Pin
Colin Angus Mackay23-Jan-07 22:39
Colin Angus Mackay23-Jan-07 22:39 
GeneralRe: TEXT datatype Pin
quiteSmart23-Jan-07 22:47
quiteSmart23-Jan-07 22:47 
QuestionRe: TEXT datatype Pin
andyharman23-Jan-07 22:54
professionalandyharman23-Jan-07 22:54 
AnswerRe: TEXT datatype Pin
quiteSmart23-Jan-07 22:59
quiteSmart23-Jan-07 22:59 
GeneralRe: TEXT datatype Pin
Colin Angus Mackay23-Jan-07 23:26
Colin Angus Mackay23-Jan-07 23:26 
GeneralRe: TEXT datatype Pin
quiteSmart23-Jan-07 23:30
quiteSmart23-Jan-07 23:30 
AnswerRe: TEXT datatype Pin
andyharman24-Jan-07 0:28
professionalandyharman24-Jan-07 0:28 
GeneralRe: TEXT datatype Pin
quiteSmart24-Jan-07 0:36
quiteSmart24-Jan-07 0:36 
QuestionRe: TEXT datatype Pin
andyharman24-Jan-07 2:17
professionalandyharman24-Jan-07 2:17 
AnswerRe: TEXT datatype Pin
quiteSmart24-Jan-07 2:24
quiteSmart24-Jan-07 2:24 
GeneralRe: TEXT datatype Pin
Colin Angus Mackay23-Jan-07 23:25
Colin Angus Mackay23-Jan-07 23:25 
AnswerAlso Pin
Ennis Ray Lynch, Jr.24-Jan-07 3:49
Ennis Ray Lynch, Jr.24-Jan-07 3:49 

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.