K
Kbalz
Trying to run a simple query on my dataset
the SQL statement looks like this: select * from person
where id in (@p)
When using more than one id in the "in statement", I get nothing!
Using Visual Studio interface, there is the Execute Query button in
Query Builder. Here I can set @p = 1, and the test execute returns
the row where id = 1.. and I can do the same for @p = 2.
However when I set @p to 1,2 or '1', '2' or any combination of all
symbols, I get nothing.
When I run select * from person where id in (1, 2) in Management
Studio, I get both rows.
How do you use the IN statement?
( Its hard to search on this topic, search engines ignore the word IN
and I just get every sql statement possible
)
the SQL statement looks like this: select * from person
where id in (@p)
When using more than one id in the "in statement", I get nothing!
Using Visual Studio interface, there is the Execute Query button in
Query Builder. Here I can set @p = 1, and the test execute returns
the row where id = 1.. and I can do the same for @p = 2.
However when I set @p to 1,2 or '1', '2' or any combination of all
symbols, I get nothing.
When I run select * from person where id in (1, 2) in Management
Studio, I get both rows.
How do you use the IN statement?
( Its hard to search on this topic, search engines ignore the word IN
and I just get every sql statement possible
