Viewing 15 posts - 391 through 405 (of 7,608 total)
When you ALTER a column, SQL creates a new column to store the data, it doesn't re-use the existing space for the new column. You'll need to do some type...
August 9, 2023 at 2:49 pm
My other feeling was that having it run multiple times (2, 3, 4?) at the start of the month could be deceptive / confusing to people looking at...
August 6, 2023 at 9:45 pm
This method of determining Tuesday:
DATEPART(weekday, @CurrentDate) = 3
requires a specific DATEFIRST setting to work correctly. Many business have locations around the world, so it's safer to use a...
August 4, 2023 at 7:36 pm
Fair enough.
In that case, let's create a view that has the merged tables for anyone to use. That is much cleaner.
August 4, 2023 at 3:46 pm
Yikes, if a developer can't join/merge two tables with distinct date values to a combined table, they need additional training, and pronto.
August 4, 2023 at 3:43 pm
Personally I prefer a nonworkdays-only table (I don't call it a "holiday" table because sometimes it's a nonwork day but not a holiday (such as for a power outage, etc.)).
That...
August 4, 2023 at 3:37 pm
<removed, dup comment>
August 4, 2023 at 3:30 pm
This method of determining Tuesday:
DATEPART(weekday, @CurrentDate) = 3
requires a specific DATEFIRST setting to work correctly. Many business have locations around the world, so it's safer to use a method that...
August 4, 2023 at 3:30 pm
@dennis Jensen:
I never presume to know the requirements of the task better than the person requesting the code.
"If the first Monday of the month is a holiday, than I need...
August 4, 2023 at 3:23 pm
I'd strongly urge you not to mess with the DATEFIRST setting. You don't need to, and it could throw off other code which might need a different setting (if the...
August 3, 2023 at 8:45 pm
I don't believe you can do this directly. However, you could have the first step of the job determine if it is a holiday, and if so, to schedule a...
August 3, 2023 at 5:39 pm
Your ordering is not guaranteed to be in the OUT ITEM order, since you don't sort by it.
July 31, 2023 at 4:05 pm
If you have a lot of rows, you'd likely get better performance putting the results (from the cte) into an indexed temp table, but for now, just see if this...
July 31, 2023 at 2:14 pm
An alternative that allows a previous open paren(s) in the input data:
DROP TABLE IF EXISTS #test2;
CREATE TABLE #test2 ( tran_log_writes nvarchar(4000) NULL );
INSERT #test2 ( tran_log_writes )...
July 25, 2023 at 2:20 pm
Personally for something this involved / complex, I'd use a custom function that parsed with pre-determination. That is, the code doesn't look only for specific names (tags) in the data,...
July 24, 2023 at 5:44 pm
Viewing 15 posts - 391 through 405 (of 7,608 total)