Viewing 15 posts - 16 through 30 (of 476 total)
Sorry, I have explained that badly. It definitely isn't a bug in SQL, but it can cause a bug in my software (if I change from ISNULL to COALESCE and...
March 2, 2021 at 10:01 am
or ... I have seen people just put a physical whiteboard behind them, in view of the camera, and just write on that.
Stops anyone else in the meeting drawing on...
March 2, 2021 at 7:24 am
COALESCE has a nasty quirk, as well. You know what it is... it uses whatever the highest precedence datatype there is in the operands. ISNULL doesn't have that problem.
That's...
March 2, 2021 at 6:11 am
Thanks Brian ... but you are not selling it to me!
To do a proper job I would need to have ability to resend a message e.g. audit log kept for...
March 2, 2021 at 5:53 am
The same argument that @Kristen makes for changing IIF to a CASE expression applies to ISNULL - are you going to change ISNULL to COALESCE when the requirements change...
March 1, 2021 at 8:04 pm
Michaels suggestion was probably this
SELECT[Date] = MAX([Date])
, city
, area
, Status
FROMMyTable
GROUP BY city
, area
, Status
which is a lot more skinny, provided that your code isn't more complicated than...
March 1, 2021 at 9:26 am
SELECT[Date]
, city
, area
, Status
FROM
(
SELECT[T_City_RowNumber] = ROW_NUMBER()
OVER
(
PARTITION BY city
ORDER BY [Date] DESC
)
, [Date]
, city
, area
, Status
FROMMyTable
) AS T
WHERET.T_City_RowNumber = 1
EDIT : I had to remove the square brackets...
March 1, 2021 at 9:20 am
Very helpful Brian, thanks. I have almost no experience of Service Broker, but we have 3rd party APPs/DBs that use it.
I have a 3rd party database where I want duplicated...
March 1, 2021 at 8:52 am
Something like this maybe
SELECT[RowNo] = ROW_NUMBER()
OVER
(
ORDER BY [Date]
)
, [Column1] = CASE WHEN DayOOS IS NOT NULL AND [T_Column1] = 1 THEN [Date] ELSE NULL END
, Id
, [Date]
,...
March 1, 2021 at 7:41 am
and others, so many others.
I would write a FUNCTION and use that to "wrap" each of the columns, then if you find "something else" that you need to be...
March 1, 2021 at 7:07 am
I dislike IIF ... its "familiar" for people that use similar functions in Excel, but I think CASE is better in SQL
IIF only has two outcomes, true/false, and to get...
February 26, 2021 at 6:06 pm
When I worked at a utility in 1991, we bought a server for US$250,000. I couldn't believe it. Wasn't sure it was worth it, but it certainly made a...
February 26, 2021 at 5:44 pm
You will probably end up with something like this
That's the part that bothers me ... why a single statement is not, inherently, atomic.
Can I be sure I have covered...
February 25, 2021 at 2:37 pm
Is this atomic in this situation? (My recollection is that it is NOT, without appropriate LOCK hint)
insert into log_test1
select(SELECT MAX(c1)+1 FROM log_test1)
, @v3
February 25, 2021 at 5:45 am
Viewing 15 posts - 16 through 30 (of 476 total)