Viewing 15 posts - 16 through 30 (of 789 total)
You can avoid COALESCE with this code:
SELECT *
,LAG(CAST(b AS VARCHAR(10)),1,'N/A')over(ORDER BY a,b)
FROM (VALUES
('a',1)
,('b',2)
,('c',3)
,('d',4)
) AS V([a],)
-- P.S. I did not test for performance.
March 2, 2021 at 8:01 am
A little typo:
name, value, level0 type of schema, level0 value of dbo, level1type of table and level1name of dbo.Adverts.
level1name should be only the name of table without the schema.
June 23, 2020 at 7:40 am
That's right!
It's good to know.
Here's to force the minus precedence:
SELECT (-100.0)/(-100.0)*10.0
June 9, 2020 at 6:52 am
The increment also is out of transactions. So, rollback doesn't restore the original value.
Also, you can not remove the property IDENTITY from a column.
This adds the IDENTITY to a column:
ALTER...
June 1, 2020 at 7:32 am
Here states different:
A.difference(B) it's the same as A-B
April 8, 2020 at 6:59 am
This is not a correct answer. There's no -m flag. From the documentation, @@cursor_rows returns -m if the cursor is being asynchronously populated. That just means a negative value m is returned by...
March 30, 2020 at 7:05 am
Sorry for [semi]colon 🙂
It's all right for error, because GO is a batch separator: @x is declared in the first batch and not in the second. It's the same as...
March 13, 2020 at 4:17 pm
A semicolumn is missing after the two exclamation mark.
Here's from BOL:
Supported SQLCMD Syntax
The Database Engine Query Editor supports the following SQLCMD script keywords:
[!!:]GO[count]
March 13, 2020 at 4:03 pm
5
Also with PRINT and RAISERROR
By that reasoning you should also include THROW, as well as modifying data in tables (particularly temp tables created by the caller).
Personally,...
February 28, 2020 at 1:10 pm
5
Also with PRINT and RAISERROR
By that reasoning you should also include THROW, as well as modifying data in tables (particularly temp tables created by the caller).
Personally, I would...
February 28, 2020 at 9:30 am
February 28, 2020 at 8:01 am
That's correct: "an empty result set preserves the existing value of the variable", NO result set, NO assignment. In the case of SET or SELECT with a subquery (as shown...
January 30, 2020 at 7:55 am
Viewing 15 posts - 16 through 30 (of 789 total)