Viewing 15 posts - 2,686 through 2,700 (of 7,614 total)
Another version, trying to do the least prep work possible (although for determining day or month first, the entire staging table may need to be scanned):
--Assumes that...
October 2, 2019 at 6:50 pm
ALTER TABLE dbo.table_name ADD MinuteToHour AS CONVERT(char(5), DATEADD(MINUTE, CONVERT(int,[sun_total]), '19000101'), 108);
September 30, 2019 at 6:46 pm
We're seeing only a partial plan with none of the actual stats and no sql query text. I can't offer any real guidance with such limited info.
September 27, 2019 at 8:46 pm
I don't think going back just 1 row will be accurate, at least as I understand the requirements (which, of course, could be incorrect). For example, assume times of:
12:24; 12:25;...
September 27, 2019 at 7:11 pm
Something along these lines should let you generate the code:
DECLARE @sql nvarchar(max)
;WITH
cte_tally10 AS (
SELECT * FROM (VALUES(0),(0),(0),(0),(0),(0),(0),(0),(0),(0)) AS numbers(number)
),
cte_tally1000 AS (
...
September 27, 2019 at 6:49 pm
Based on my reading of Netezza syntax online:
IF DATE_PART('DOW',CURRENT_DATE) IN ('3','6') THEN
statement
[statement] ...
END IF;
September 27, 2019 at 6:25 pm
The two UPDATEs are already executed in separate transactions. Since you don't have an explicit BEGIN TRANSACTION, every statement will be treated as a separate transaction by default.
Since the subquery...
September 27, 2019 at 3:42 pm
You can add SET ARITHABORT ON to the trigger, but it may not help, because the error may be raised when the trigger is compiled the first time.
I don't understand...
September 25, 2019 at 8:42 pm
You can use SET ARITHABORT and other SET statements within the trigger itself. Those settings will be discarded when the trigger ends, so you can't do any harm to outside...
September 25, 2019 at 6:06 pm
One should always try to avoid a function on a table column being used for lookup. Therefore, for the last JOIN, do this instead:
LEFT JOIN...
September 24, 2019 at 4:55 pm
You don't really need to join, an EXISTS check will do fine. The optimizer may rewrite it that way anyway, but it doesn't hurt to code it that way yourself:
September 23, 2019 at 5:52 pm
You could also add a new filegroup and move the large tables into the new filegroup. Then shrink the original file. The big disadvantage, of course, is that you now...
September 20, 2019 at 6:59 pm
Try:
EXEC sys.sp_depends 'BotCBO.vwClovekNameStrings_PrZk'
September 20, 2019 at 5:12 pm
I've never been able to find a way to do this. I ended up using CONTEXT_INFO() [*] or sp_set_session_context to pass the database_id to the called proc. [*] With provisions...
September 18, 2019 at 4:38 pm
The easiest way to verify it is to look at the query plan. You should be able to see that SQL is not actually pulling all the columns from that...
September 17, 2019 at 6:11 pm
Viewing 15 posts - 2,686 through 2,700 (of 7,614 total)