Viewing 15 posts - 391 through 405 (of 1,464 total)
Your code will replace "Test" with "Dev" in the ServerType column for the entire table.
If you wish to only do the update where Company is "Blue", then you need to...
November 27, 2019 at 6:58 am
SSC has an article by Sean Smith with code for playing Battleships in SSMS
November 20, 2019 at 2:50 pm
Try this on for size
DECLARE @FormType varchar(50); -- Adjust data type and size to match [f1] + [f2] + [f3]
SET @FormType = ISNULL( (SELECT FormType = ltrim(RTRIM(ISNULL(f1,'')+ISNULL(f2,'')+ISNULL(f3,'')))
...
November 20, 2019 at 3:44 am
I suppose a code sample for the Dynamic SQL might help
DECLARE
@Eid ...
November 19, 2019 at 9:07 pm
This is a classic Catch-All query.
November 19, 2019 at 6:47 pm
All of those UNIONs are creating an insane query plan.
The following code will produce almost the same result, with a MUCH better query plan.
DECLARE @options int =...
November 14, 2019 at 10:02 am
IF (SELECT count(emp.name) FROM **** WHERE *** IN (***)) > 0
BEGIN
SELECT 1;
END;
ELSE
BEGIN
SELECT 0;
END;
November 14, 2019 at 4:34 am
FORMAT is a dog when comes to performance.
You would be better off using CONVERT.
The following 2 expressions return the same result. Although formatting is best left to the presentation...
November 13, 2019 at 4:22 am
I stand to be corrected here, but NOLOCK on a #temptable has no effect. The #temptable is local to your SPID, so there is nobody else reading or writing to...
November 13, 2019 at 4:14 am
Your SQL is not valid.
Your description of the problem does not make sense.
Kindly provide readily consumable sample data, your expected outcome, and a functioning SQL statement.
November 12, 2019 at 3:21 pm
Shifting gears a bit, have a look at the original post on the following thread (no need to pile on.. I'm just confused) ...
The OP posted this early...
November 12, 2019 at 6:34 am
I would start by trying to replace
IF 0 < (SELECT COUNT(*)
with
IF EXISTS (SELECT 1
Next check your statistics. the massive disparity between estimated and actual...
November 12, 2019 at 4:27 am
So, based on your sample data, what is your expected result?
November 11, 2019 at 7:09 pm
Because the logical query processing order will process the join before the where, it MIGHT improve performance slightly if you search for the Commodities before searching for the Suppliers.
November 11, 2019 at 1:14 pm
Viewing 15 posts - 391 through 405 (of 1,464 total)