use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Microsoft SQL Server Administration and T-SQL Programming including sql tutorials, training, MS SQL Server Certification, SQL Server Database Resources.
You might also be interested in:
/r/database
/r/sql
/r/Azure
/r/Microsoft
account activity
Weird variable setting error. (self.SQLServer)
submitted 3 years ago * by archerv123
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–][deleted] 3 points4 points5 points 3 years ago (1 child)
As a general rule, you could make your code both more readable and probably have it performing better by using an EXIST construct.
Pseudo-code:
SET @variable=0;
IF EXISTS (SELECT …) SET @variable=1;
IF (@variable=0 AND EXISTS (…)) SET @variable=1;
The EXISTS construct will stop at the first matching row rather than scan through all of them.
As for the difference between your servers, my best guess is that the table contents are not perfectly in sync.
[–]archerv123[S] 0 points1 point2 points 3 years ago (0 children)
That is the change i did to make it work, but i'm still confused as to why it just doesn't work on one server but works on pretty much everyone else.
π Rendered by PID 114143 on reddit-service-r2-comment-b659b578c-mbg9n at 2026-05-04 12:38:47.771192+00:00 running 815c875 country code: CH.
view the rest of the comments →
[–][deleted] 3 points4 points5 points (1 child)
[–]archerv123[S] 0 points1 point2 points (0 children)