Viewing 15 posts - 646 through 660 (of 7,614 total)
Great point; sorry, I accidentally left out that "current year" requirement.
September 14, 2022 at 2:22 pm
If you just want the MemberID, then as below. Of course you can adjust the query against the cte to pull more columns if you want them. Either way, I...
September 13, 2022 at 11:12 pm
You want the unique clustered index on ( date_, ID_vard ), assuming that you do primarily query the table by date_, and not on just ID_vard.
Can you clarify...
September 13, 2022 at 4:08 pm
You want the unique clustered index on ( date_, ID_vard ), assuming that you do primarily query the table by date_, and not on just ID_vard.
September 13, 2022 at 2:48 pm
You likely should encode the room name for internal use -- I'd probably call it "room_code" -- but you'll need at least a smallint, and I'd probably just "byte" the...
September 12, 2022 at 8:04 pm
I am going to add this statement at the top of the SP, it will prevent or minimize deadlocks:
SET DEADLOCK_PRIORITY HIGH
No, it won't. Instead, it will force SQL to kill...
September 12, 2022 at 7:51 pm
Change the WHERE conditions to match:
...
WHERE ControlPointName NOT LIKE 'WD%' AND ControlPointName NOT LIKE 'WM%' and --<<-- "day = " removed
( (month = @month and year = @year...
September 8, 2022 at 11:38 pm
I think it would be as below. You must put the partition values in alpha order.
CREATE PARTITION FUNCTION PF_Postcode(varchar(100))
AS RANGE LEFT FOR VALUES
(
'7420_FMIL',
'C7_4JM',
'ND8_1ZE'
)
September 8, 2022 at 11:35 pm
Hi Scott, getting an error on Column not found in this piece;
MAX(CASE WHEN month = @month AND year = @year THEN ControlPointName END)
That one is part of the...
September 8, 2022 at 4:33 pm
Run CHECKDB to determine errors. Backup the existing db to make sure you'll never be worse off than you are now.
If an error is in a non-clustered index, simply drop...
September 8, 2022 at 4:30 pm
I think this will do it, but I have not tested it.
SELECT
MAX(CASE WHEN month = @month AND year = @year THEN ControlPointName END)...
September 8, 2022 at 4:13 pm
I'd strongly urge you to avoid a tinyint. Mainly because the room number is "904", not just 4 (and not 94). If you think about it, "room 4"...
September 7, 2022 at 4:25 pm
;WITH cte_test_data AS (
SELECT CAST('163 Bathroom {BATHROOM CLEANING}{2.5%}' AS varchar(100)) AS string
)
SELECT
string AS original_string,
CASE WHEN...
September 7, 2022 at 4:18 pm
I'd strongly urge you to avoid a tinyint. Mainly because the room number is "904", not just 4 (and not 94). If you think about it, "room 4" is meaningless,...
September 6, 2022 at 3:47 pm
I have to say, in this case I would use a char/varchar column for room numbers, not an int. Even if the hotel guest rooms are all...
September 4, 2022 at 11:38 pm
Viewing 15 posts - 646 through 660 (of 7,614 total)