Viewing 15 posts - 16 through 30 (of 58 total)
There are other ways for enforcing cardinality of 1. here is one of them:
CREATE TABLE SingleRowTable
(
DataColumn varchar or whatever
, CheckColumn int UNIQUE CHECK (CheckColumn=1)
)
CheckColum can store 1...
November 29, 2023 at 3:46 pm
I agree with Jeff 100%. Performance is paramount, assuming the foundation is sound. Bot fast and safe at the same time is an ultimate goal, but at the same time...
July 14, 2023 at 8:09 pm
I must commend the author for this one
"In some situations, there is no column guaranteed to be unique for each entry, and developers might be tempted to rely on surrogate...
July 14, 2023 at 3:02 pm
How about avoiding UPDATE altogether, this query seemed fast enough to me:
WITH Last_Columns AS
(
SELECT object_id, MAX(column_id) AS LastCol
FROM #columns
GROUP BY object_id
)
SELECT T.Object_ID, C.LastCol
FROM #tbl AS T
JOIN Last_Columns...
July 14, 2023 at 1:56 pm
Grant is very right. When you want to apply LEFT OUTER JOIN to a subset of outer table, do not place condition in WHERE clause. Place it in ON clause.
Itzik...
September 20, 2022 at 3:15 pm
"
The primary problem is management. They tolerate mediocre performance and they set the standards.
As long as we rely on Full-Stack-Developers, SQL will go the way of the dodo. Sure, like...
September 7, 2022 at 3:43 pm
<quote>UPDATE dbo.table_name SET column = ABS(column - 1)<quote>
Nice touch! I have not seen this trick in a long time. Congrats and thank you 🙂
August 16, 2022 at 7:37 pm
ZZartin: "This is only partially true, database constraints can prevent bad data from getting into the data base. They do not however free developers from having to both know/understand those...
August 15, 2022 at 8:16 pm
This is for @skeleton567, post with a Bible quote 🙂
I am not blaming neither DBAs nor developers. It is simply true. Good database design actually frees developers from enforcing data...
August 15, 2022 at 6:19 pm
One more small thing: if we are dealing with poor database design, sometimes neither tuning nor hardware helps.
August 12, 2022 at 7:02 pm
Can the poster show us how was the problem resolved. "If a table does not have DateCreated, how would 'the system' know which of its rows to select?"
August 10, 2022 at 8:21 pm
- Add wizard for PIVOT, like one in MS Access
- Expand list of Boolean operators, add implication => and equivalence <=>. It is cumbersome and confusing writing NOT P OR...
August 8, 2022 at 8:51 pm
Thi is what you gave us, approximately:
DROP TABLE IF EXISTS #Doctors
GO
CREATE TABLE #Doctors
(
WorkDayDate date
, Pathologist nvarchar(50)
, [Today Pathologist had 6 cases] int
, [Today Pathologist had 7 cases]...
August 8, 2022 at 8:31 pm
Can you clarify the question? What does he "line before negative line" means? Is it negative Amount or negative Balance? In the example, you are actually displaying all "positive" lines...
August 8, 2022 at 5:11 pm
Please read the answer from pietlinden. Yo must provide CREATE TABLE statements and sample data, which allows to see the goal.
No table structure, no data => no help available
August 8, 2022 at 4:13 pm
Viewing 15 posts - 16 through 30 (of 58 total)