Viewing 15 posts - 1,411 through 1,425 (of 6,036 total)
Try this trigger:
CREATE TRIGGER RAC_logon_trigger
ON ALL SERVER
WITH
EXECUTE AS 'sa'
FOR LOGON
...
May 27, 2016 at 12:11 am
It's also not such a bright idea to create a new object in tempdb on every logon.
Get rid of @IP and replace it with a static table:
1. Hardcoding parameters is...
May 26, 2016 at 11:58 pm
Why do you need all those horrible XML and dmv queries?
SELECT @SessionId = @data.value ('(/EVENT_INSTANCE/SPID)[1]', 'int');
SELECT @HostName = @data.value ('(/EVENT_INSTANCE/ClientHost)[1]', 'sysname');
...
May 26, 2016 at 11:52 pm
ChrisM@home (5/26/2016)
Using a clustered index like so:
CREATE CLUSTERED INDEX [cx_Stuff] ON [dbo].[ann_events_Tech_Details]([source] ASC, [start_time] ASC)
Such clustered may be very good on query but it's gonna be a very high cost...
May 26, 2016 at 4:30 pm
John Mitchell-245523 (5/26/2016)
Sergiy (5/25/2016)
And from looking at the overall design I can conclude the clustered index on ReportItem must be(report_id, flow_name, report_item) INCLUDE (source)
Do you mean (report_id, flow_name, report_item,...
May 26, 2016 at 5:20 am
jc85 (5/26/2016)
Sergiy (5/25/2016)
SELECT dateadd(dd,0, datediff(dd,0,b.start_time)) as [date], b.source, b.lang, SUM(b.sel_test) Test, SUM(b.sel_test2) Test2
FROM TechDetails b
WHERE b.start_time...
May 26, 2016 at 5:17 am
SUM(-GL10111.CRDTAMNT + GL10111.DEBITAMT + PREV.PERDBLNC - GL10111.PERDBLNC) - ( GL10111.DEBITAMT - GL10111.CRDTAMNT )
Something does not look right here.
May 26, 2016 at 12:37 am
There are 2 ways to go.
1. Pay to a qualified SQL developer who knows about normalisation rules and tends to follow them to develop a new, proper database to support...
May 25, 2016 at 6:38 pm
If that one goes not so bad then incorporate it into the bigger one:
SELECT DT.date, (a.source + '-' + a.report_item) as report_item,
SUM(CASE WHEN b.lang = 'EN' THEN CASE a.report_item WHEN...
May 25, 2016 at 5:36 pm
How does this query perform?
SELECT dateadd(dd,0, datediff(dd,0,b.start_time)) as [date], b.source, b.lang, SUM(b.sel_test) Test, SUM(b.sel_test2) Test2
FROM TechDetails b
WHERE b.start_time >= @StartDate
AND b.start_time < dateadd(dd,0, datediff(dd,0,@EndDate)+1)
GROUP BY dateadd (dd, 0,...
May 25, 2016 at 5:21 pm
jc85 (5/25/2016)
The query took quite some time to complete.
Additional info provided in case you need it.
ann_events_Tech_Details
[start_time] - clustered index
[id] - Unique, non-clustered index (PK)
ann_ReportItem
[source] - non-clustered index
[call_flow_name] -...
May 25, 2016 at 4:21 am
jc85 (5/24/2016)
Both tables already have id set as their clustered index so I will drop [start_time].
This is exactly the problem.
Make both PK's non-clustered and create a new clustered index on...
May 24, 2016 at 11:19 pm
Lynn Pettis (5/24/2016)
I have to agree with Steve. I would also look at the indexes you have on the tables. If you have good clustered indexes that don't...
May 24, 2016 at 10:49 pm
jc85 (5/24/2016)
Added start_time as Non-clustered index for table ann_events_Tech_Details.
Make it clustered.
Otherwise - drop it, no use of it anyway.
Added report_id, report_item, call_flow_name, source as Non-clustered index for table ann_ReportItem
[Source] must...
May 24, 2016 at 4:17 pm
ben.brugman (5/19/2016)
I do agree not allowing xp_cmdshell makes security tighter.
There is simply no way to actually disallow xp_cmdshell.
If you know one - please share it with us.
May 23, 2016 at 12:11 am
Viewing 15 posts - 1,411 through 1,425 (of 6,036 total)