2
votes
SQL Query execution with IN statement
N'''2'',''3''' is a scalar value - as in a string: "'2','3'". SqlServer treats it as a singular string, when you use it as a parameter in your query.
One solution could be to use WHERE IN (...
1
vote
Accepted
Is it safe to use user defined variables inside stored procedures in MySQL?
User-defined variables are specific to the session where they were set. They don't leak over to other sessions.
Each session has its own variables. A variable of the same name in a different session ...
1
vote
SQL Query execution with IN statement
Your scalar string is just that: a string. The compiler doesn't embed your value directly into your query. It creates a placeholder string variable during compilation, then binds the value directly to ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
stored-procedures × 1589sql-server × 715
mysql × 377
t-sql × 150
oracle × 107
sql-server-2008 × 95
postgresql × 94
performance × 87
sql-server-2012 × 79
trigger × 75
sql-server-2008-r2 × 65
permissions × 65
sql-server-2016 × 56
functions × 56
sql-server-2014 × 55
plsql × 55
dynamic-sql × 46
transaction × 37
query-performance × 35
sql-server-2005 × 35
optimization × 33
parameter × 31
view × 29
db2 × 28
insert × 28