New answers tagged

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 ...
user avatar
  • 9,746
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 ...
user avatar
  • 5,643
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 (...
user avatar
  • 208
0 votes

stored procedure runs fine in all sessions but one

I wish I had more rep so I could just leave a comment on Marcello's answer... But I would recommend against the global temp table as they're often a security risk since any session can access it's ...
user avatar
0 votes
Accepted

stored procedure runs fine in all sessions but one

I found a way out of this problem. I could not find out nor took the time to understand why exactly only one session was having this issue. This procedure of mine is packed with dynamic sql, and it ...
user avatar
0 votes
Accepted

Why is my auto-restore procedure not dropping the databases when I expect it to?

Several years later, I figured this out. It's one of those facepalm moments; one simple missed command caused me to look into this issue several times over the years, but it was never a high enough ...
user avatar
  • 227

Top 50 recent answers are included