Quantcast
Channel: SQLServerCentral » SQL Server 2008 » SQL Server 2008 - General » Latest topics
Viewing all 16406 articles
Browse latest View live

Need help to get prevoius 4 hrs data

$
0
0
Hi,I need 4 hrs previous data based on "start_execution_date" column.I am adding below condition at the end of the query"start_execution_date >= DATEADD(Hour,-4,start_execution_date)" in below t-sql but, it's not working. Plz help.DECLARE @JobDetails TABLE ( job_id UNIQUEIDENTIFIER NOT NULL, last_run_date INT NOT NULL, last_run_time INT NOT NULL, next_run_date INT NOT NULL, next_run_time INT NOT NULL, next_run_schedule_id INT NOT NULL, requested_to_run INT NOT NULL, request_source INT NOT NULL, request_source_id sysname COLLATE database_default NULL, running INT NOT NULL, current_step INT NOT NULL, current_retry_attempt INT NOT NULL, job_state INT NOT NULL )INSERT INTO @JobDetailsEXECUTE master.dbo.xp_sqlagent_enum_jobs 1, 'sa'SELECT * FROM (SELECT name, enabled = CASE WHEN enabled = 1 THEN 'Yes' ELSE 'No' END, date_created, date_modified, last_run_date, start_execution_date = CASE WHEN jd.running = 1 THEN GETDATE() ELSE start_execution_date END, Status = CASE WHEN jd.running = 1 THEN 'Running' ELSE sjh.Status END, next_scheduled_run_date, sj.job_id, jd.runningFROM msdb.dbo.sysjobs sj WITH(NOLOCK) INNER JOIN (SELECT job_id, start_execution_date = MAX(start_execution_date), next_scheduled_run_date = MAX(next_scheduled_run_date) FROM msdb.dbo.sysjobactivity WITH(NOLOCK) GROUP BY job_id ) sja ON sj.job_id = sja.job_id LEFT OUTER JOIN (SELECT a.job_id, Status = CASE WHEN run_status = 0 THEN 'Failed' WHEN run_status = 1 THEN 'Succeeded' WHEN run_status = 2 THEN 'Retry' WHEN run_status = 3 THEN 'Cancelled' WHEN run_status = 4 THEN 'In progress' END FROM msdb.dbo.sysjobhistory a WITH(NOLOCK) INNER JOIN (SELECT job_id, instance_id = MAX(instance_id) FROM msdb.dbo.sysjobhistory WITH(NOLOCK) GROUP BY job_id ) b ON a.job_id = b.job_id AND a.instance_id = b.instance_id ) sjh ON sj.job_id = sjh.job_id INNER JOIN @JobDetails jd ON sjh.job_id = jd.job_id) a[highlight="Yellow"]WHERE a.start_execution_date >= DATEADD(Hour,-4,a.start_execution_date)[/highlight]ORDER BY nameThanks in Advnc.

SQL Data Collector Help

$
0
0
Hi, I have enabled the SQL Data Collector on our production system. I'm relatively new to using it and its been enabled for a few months now. The data file for the database is about 22Gigs at the moment and I want to be proactive and keep this size around 10gigs at all times if possible. I see there is a sp_purge_data stored procedure and I see there is a job that is executing all the time for this. It is at the default settings, so its not passing any variables to this procedure.If I want it to only save data for like 2 months max... do I just need to alter the step of this job that is running all the time? Would I then need to shrink the database afterward? My customer is very stingy on storage space and they will not allocate more space to us. I'm also a little clunky with the information that it provides...should I be going in and executing some snapshot reports and storing them off somewhere so that I can purge the data and not miss anything valuable? Thanks in advance.

Alerting if table is empty

$
0
0
Hi All,I am looking for a way to get an alert from SQL Agent if any table is empty in a database with the name of the table.

How to exclude text values and only include numbers in a varchar column

$
0
0
I have a table with Lab values in it. The lab lest results can either be a number or a comment such as "Unable to perform". Is there a function that I can use to pull only the numbers? IsNumeric doesn't seem to work.

High lob logical reads on a query with just 2 simple tables

$
0
0
[code="sql"]/*Table1: NotificationType (NotificationTypeID INT PK Clustered, NotificationCriteria xml, TypeName Varchar(200), Deleted char(1))Table1 has 25 rowsTable2: Subscription (SubscriptionID INT PK Clustered, NotificationTypeID FK, SubscriberID, SubscriptionCriteria xml, Status smallint, Deleted char(1))Table2 has 3000 rows*/SELECT t1.SubscriptionID, t1.NotificationTypeID, t2.NotificationCriteria --xml field (for notificationTypeID = 12, the length of xml field is 12000 characters), t1.SubscriberID, t1.SubscriptionCriteria --xml field, t1.Status, t1.FailedDate FROM Subscription t1 WITH (NOLOCK) INNER JOIN NotificationType t2 ON t2.NotificationTypeID = t1.NotificationTypeID WHERE t2.NotificationTypeID = 12 --only 1 row exists AND t1.Status != 1 --Inactive AND t1.Status != 2 --Failed AND t1.Deleted <> 'N' with statistics io set to on(2045 row(s) affected)Table 'Subscription'. Scan count 2, logical reads 498, physical reads 0, read-ahead reads 0, lob logical reads 491, lob physical reads 0, lob read-ahead reads 421.Table 'NotificationType'. Scan count 0, logical reads 2, physical reads 0, read-ahead reads 0, lob logical reads 14333, lob physical reads 0, lob read-ahead reads 16232.[/code]Takes around 12-15 seconds to runCould someone let me know why is the lob logical reads way too high for table NotificationType although it is returning only 1 row for NotificationTypeID = 12 !!Thanks,KB

How to get the previous weeks data based on week ending

$
0
0
I need to get a weekly count of records with Friday being the end of the week. So, the report will run on Friday and return the previous Friday through Thursday. [code="sql"]create table #Test(AccountNumber varchar(30),DischargeDateTime datetime,RegistrationDateTime datetime,day_of_week char(1))insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090033386','2016-05-01 19:39:00.000','2016-05-01 15:58:23.000','1')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090034846','2016-05-02 20:52:00.000','2016-05-02 16:49:26.000','2')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090039309','2016-05-05 19:27:00.000','2016-05-05 16:22:29.000','5')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090041161','2016-05-07 19:42:00.000','2016-05-07 18:03:09.000','7')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090041177','2016-05-07 21:01:00.000','2016-05-07 18:57:16.000','7')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090041178','2016-05-07 21:38:00.000','2016-05-07 19:11:03.000','7')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090041190','2016-05-07 22:51:00.000','2016-05-07 20:19:13.000','7')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090041191','2016-05-08 00:48:00.000','2016-05-07 20:25:29.000','1')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090041196','2016-05-08 01:09:00.000','2016-05-07 20:49:56.000','1')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090042864','2016-05-09 19:57:00.000','2016-05-09 17:14:35.000','2')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090042918','2016-05-09 21:24:00.000','2016-05-09 18:13:13.000','2')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090042826','2016-05-09 22:05:00.000','2016-05-09 16:49:25.000','2')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090042911','2016-05-09 22:16:00.000','2016-05-09 18:01:06.000','2')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090043020','2016-05-10 00:00:00.000','2016-05-09 20:42:35.000','3')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090042934','2016-05-10 00:02:00.000','2016-05-09 18:54:37.000','3')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090043089','2016-05-10 00:43:00.000','2016-05-09 22:57:58.000','3')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090044390','2016-05-10 19:32:00.000','2016-05-10 17:07:01.000','3')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090046070','2016-05-12 01:47:00.000','2016-05-11 20:43:13.000','5')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090046071','2016-05-12 02:00:00.000','2016-05-11 20:48:35.000','5')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090047144','2016-05-12 18:45:00.000','2016-05-12 15:41:37.000','5')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090047329','2016-05-12 21:28:00.000','2016-05-12 18:59:29.000','5')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090047333','2016-05-12 21:52:00.000','2016-05-12 19:04:12.000','5')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090047414','2016-05-13 01:39:00.000','2016-05-12 21:13:18.000','6')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090048729','2016-05-13 22:09:00.000','2016-05-13 20:38:40.000','6')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090048741','2016-05-13 22:30:00.000','2016-05-13 21:22:09.000','6')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090048686','2016-05-13 22:53:00.000','2016-05-13 19:51:31.000','6')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090049083','2016-05-14 17:57:00.000','2016-05-14 16:32:19.000','7')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090049094','2016-05-14 18:52:00.000','2016-05-14 17:17:29.000','7')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090049355','2016-05-15 17:12:00.000','2016-05-15 15:43:40.000','1')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090049360','2016-05-15 17:59:00.000','2016-05-15 16:25:51.000','1')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090049375','2016-05-15 18:27:00.000','2016-05-15 17:09:08.000','1')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090049382','2016-05-15 21:16:00.000','2016-05-15 17:25:12.000','1')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090049441','2016-05-16 00:18:00.000','2016-05-15 22:45:33.000','2')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090049429','2016-05-16 00:19:00.000','2016-05-15 20:45:42.000','2')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090050478','2016-05-16 18:08:00.000','2016-05-16 15:11:47.000','2')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090050714','2016-05-16 21:17:00.000','2016-05-16 17:05:59.000','2')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090050895','2016-05-17 02:14:00.000','2016-05-16 22:10:01.000','3')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090053726','2016-05-18 21:14:00.000','2016-05-18 18:36:57.000','4')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090053670','2016-05-18 21:23:00.000','2016-05-18 17:07:43.000','4')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090053692','2016-05-18 21:37:00.000','2016-05-18 17:39:31.000','4')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090053700','2016-05-18 22:19:00.000','2016-05-18 17:50:59.000','4')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090055009','2016-05-19 18:45:00.000','2016-05-19 16:02:01.000','5')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090055061','2016-05-19 18:50:00.000','2016-05-19 16:37:00.000','5')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090055154','2016-05-19 21:54:00.000','2016-05-19 18:35:38.000','5')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090056314','2016-05-20 17:08:00.000','2016-05-20 15:29:06.000','6')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090056560','2016-05-21 00:20:00.000','2016-05-20 18:24:37.000','7')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090056990','2016-05-21 18:44:00.000','2016-05-21 16:14:05.000','7')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090057014','2016-05-21 21:28:00.000','2016-05-21 18:39:54.000','7')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090057240','2016-05-22 18:48:00.000','2016-05-22 16:59:05.000','1')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090057244','2016-05-22 19:20:00.000','2016-05-22 17:16:08.000','1')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090057280','2016-05-22 22:54:00.000','2016-05-22 19:09:58.000','1')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090059916','2016-05-24 21:48:00.000','2016-05-24 15:41:02.000','3')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090061586','2016-05-25 23:43:00.000','2016-05-25 20:11:09.000','4')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090062751','2016-05-26 17:14:00.000','2016-05-26 15:11:00.000','5')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090062871','2016-05-26 19:05:00.000','2016-05-26 16:14:53.000','5')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090062932','2016-05-26 19:12:00.000','2016-05-26 16:50:05.000','5')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090063101','2016-05-27 01:20:00.000','2016-05-26 21:39:46.000','6')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090064201','2016-05-27 18:35:00.000','2016-05-27 16:33:45.000','6')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090064240','2016-05-27 19:58:00.000','2016-05-27 17:08:54.000','6')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090064953','2016-05-29 16:46:00.000','2016-05-29 15:37:26.000','1')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090064947','2016-05-29 16:52:00.000','2016-05-29 15:19:38.000','1')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090064948','2016-05-29 17:49:00.000','2016-05-29 15:22:10.000','1')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090064944','2016-05-29 18:00:00.000','2016-05-29 15:10:11.000','1')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090064960','2016-05-29 18:56:00.000','2016-05-29 16:44:36.000','1')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090064955','2016-05-29 19:16:00.000','2016-05-29 15:52:19.000','1')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090065256','2016-05-30 20:29:00.000','2016-05-30 16:56:14.000','2')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090065286','2016-05-30 23:41:00.000','2016-05-30 18:22:48.000','2')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090066584','2016-05-31 22:10:00.000','2016-05-31 16:57:31.000','3')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090066617','2016-05-31 22:50:00.000','2016-05-31 17:37:49.000','3')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090068222','2016-06-01 22:24:00.000','2016-06-01 19:53:31.000','4')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090069469','2016-06-02 19:12:00.000','2016-06-02 15:31:16.000','5')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090069514','2016-06-02 19:25:00.000','2016-06-02 15:48:48.000','5')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090069707','2016-06-02 22:09:00.000','2016-06-02 18:58:05.000','5')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090071627','2016-06-05 18:10:00.000','2016-06-05 15:01:51.000','1')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090071716','2016-06-05 21:20:00.000','2016-06-05 19:20:25.000','1')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090073103','2016-06-06 23:32:00.000','2016-06-06 18:08:54.000','2')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090073129','2016-06-06 23:48:00.000','2016-06-06 18:45:49.000','2')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090073146','2016-06-07 01:07:00.000','2016-06-06 19:36:19.000','3')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090076129','2016-06-08 23:31:00.000','2016-06-08 18:51:39.000','4')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090077267','2016-06-09 16:47:00.000','2016-06-09 15:43:09.000','5')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090077436','2016-06-09 22:14:00.000','2016-06-09 17:53:59.000','5')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090077466','2016-06-09 23:21:00.000','2016-06-09 19:02:34.000','5')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090078638','2016-06-10 18:00:00.000','2016-06-10 16:19:50.000','6')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090078515','2016-06-10 18:14:00.000','2016-06-10 15:16:57.000','6')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090078678','2016-06-10 20:05:00.000','2016-06-10 16:52:33.000','6')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090078699','2016-06-10 21:53:00.000','2016-06-10 17:31:38.000','6')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090079172','2016-06-11 19:28:00.000','2016-06-11 15:51:18.000','7')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090079223','2016-06-11 23:39:00.000','2016-06-11 19:19:39.000','7')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090079244','2016-06-12 00:48:00.000','2016-06-11 20:38:42.000','1')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090079262','2016-06-12 01:08:00.000','2016-06-11 22:42:53.000','1')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090079455','2016-06-12 17:17:00.000','2016-06-12 15:17:05.000','1')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090079478','2016-06-12 17:57:00.000','2016-06-12 16:50:52.000','1')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090079473','2016-06-12 18:39:00.000','2016-06-12 16:13:44.000','1')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090082280','2016-06-14 21:18:00.000','2016-06-14 15:42:09.000','3')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090082471','2016-06-14 22:26:00.000','2016-06-14 17:32:38.000','3')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090082647','2016-06-15 01:06:00.000','2016-06-14 21:59:09.000','4')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090082646','2016-06-15 02:40:00.000','2016-06-14 21:34:57.000','4')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090083884','2016-06-15 18:06:00.000','2016-06-15 16:32:40.000','4')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090083968','2016-06-15 18:54:00.000','2016-06-15 18:09:25.000','4')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090086571','2016-06-17 19:43:00.000','2016-06-17 18:33:10.000','6')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090087032','2016-06-19 01:05:00.000','2016-06-18 22:23:33.000','1')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090087246','2016-06-19 19:57:00.000','2016-06-19 18:27:35.000','1')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090090038','2016-06-21 20:20:00.000','2016-06-21 16:44:40.000','3')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090090106','2016-06-21 20:45:00.000','2016-06-21 18:17:37.000','3')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090091596','2016-06-22 20:49:00.000','2016-06-22 16:29:50.000','4')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090093076','2016-06-23 21:55:00.000','2016-06-23 16:49:48.000','5')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090095103','2016-06-26 18:20:00.000','2016-06-26 16:02:15.000','1')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090095101','2016-06-26 19:24:00.000','2016-06-26 15:59:04.000','1')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090099722','2016-06-29 23:03:00.000','2016-06-29 20:45:06.000','4')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090099769','2016-06-29 23:55:00.000','2016-06-29 21:19:18.000','4')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090100931','2016-06-30 18:10:00.000','2016-06-30 16:34:23.000','5')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090105998','2016-07-06 22:34:00.000','2016-07-06 20:37:08.000','4')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090106000','2016-07-06 22:35:00.000','2016-07-06 20:44:36.000','4')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090105992','2016-07-07 00:35:00.000','2016-07-06 20:25:46.000','5')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090106035','2016-07-07 02:11:00.000','2016-07-06 21:51:28.000','5')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090106028','2016-07-07 02:20:00.000','2016-07-06 21:32:36.000','5')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090107440','2016-07-07 23:51:00.000','2016-07-07 19:14:40.000','5')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090108720','2016-07-08 22:16:00.000','2016-07-08 19:19:33.000','6')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090108719','2016-07-08 22:33:00.000','2016-07-08 19:09:43.000','6')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090108698','2016-07-08 23:05:00.000','2016-07-08 18:34:44.000','6')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090108811','2016-07-08 23:35:00.000','2016-07-08 21:01:07.000','6')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090109103','2016-07-09 21:45:00.000','2016-07-09 15:01:17.000','7')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090109384','2016-07-10 18:45:00.000','2016-07-10 16:39:45.000','1')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090109393','2016-07-10 20:38:00.000','2016-07-10 17:27:44.000','1')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090110802','2016-07-11 21:48:00.000','2016-07-11 18:57:00.000','2')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090110913','2016-07-11 23:41:00.000','2016-07-11 22:13:41.000','2')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090113306','2016-07-13 18:30:00.000','2016-07-13 16:02:40.000','4')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090113350','2016-07-13 20:45:00.000','2016-07-13 16:36:01.000','4')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090113572','2016-07-13 23:41:00.000','2016-07-13 20:59:16.000','4')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090116087','2016-07-15 23:13:00.000','2016-07-15 19:20:07.000','6')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090116468','2016-07-16 23:47:00.000','2016-07-16 21:09:19.000','7')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090116622','2016-07-17 16:50:00.000','2016-07-17 15:14:19.000','1')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090116634','2016-07-17 18:19:00.000','2016-07-17 15:53:25.000','1')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090116643','2016-07-17 19:00:00.000','2016-07-17 16:36:20.000','1')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090118066','2016-07-18 20:27:00.000','2016-07-18 18:06:47.000','2')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090118099','2016-07-18 22:39:00.000','2016-07-18 19:14:07.000','2')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090118100','2016-07-19 00:20:00.000','2016-07-18 19:18:11.000','3')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090120791','2016-07-20 19:50:00.000','2016-07-20 16:22:50.000','4')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090120765','2016-07-20 20:55:00.000','2016-07-20 16:07:38.000','4')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090123351','2016-07-22 16:51:00.000','2016-07-22 15:35:36.000','6')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090123453','2016-07-22 18:43:00.000','2016-07-22 17:00:05.000','6')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090123455','2016-07-22 19:03:00.000','2016-07-22 17:02:43.000','6')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090123464','2016-07-22 19:04:00.000','2016-07-22 17:15:34.000','6')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090123538','2016-07-22 22:05:00.000','2016-07-22 20:20:20.000','6')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090123547','2016-07-23 01:42:00.000','2016-07-22 21:09:45.000','7')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090123838','2016-07-23 18:37:00.000','2016-07-23 16:28:03.000','7')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090125416','2016-07-25 20:40:00.000','2016-07-25 17:00:52.000','2')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090126846','2016-07-26 19:37:00.000','2016-07-26 17:00:59.000','3')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090126969','2016-07-27 02:05:00.000','2016-07-26 19:53:23.000','4')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090128313','2016-07-27 20:02:00.000','2016-07-27 17:44:32.000','4')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090128288','2016-07-27 22:27:00.000','2016-07-27 17:22:22.000','4')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090129604','2016-07-29 03:01:00.000','2016-07-28 17:33:25.000','6')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090130970','2016-07-30 00:22:00.000','2016-07-29 19:40:10.000','7')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090133170','2016-08-02 00:06:00.000','2016-08-01 18:55:47.000','3')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090134713','2016-08-02 23:35:00.000','2016-08-02 21:04:30.000','3')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090138890','2016-08-05 20:04:00.000','2016-08-05 18:16:02.000','6')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090139249','2016-08-06 16:38:00.000','2016-08-06 15:20:39.000','7')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090139261','2016-08-06 18:33:00.000','2016-08-06 16:39:52.000','7')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090139502','2016-08-07 17:37:00.000','2016-08-07 15:22:13.000','1')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090139558','2016-08-07 22:51:00.000','2016-08-07 21:58:31.000','1')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090139547','2016-08-07 23:00:00.000','2016-08-07 19:55:27.000','1')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090140593','2016-08-08 17:59:00.000','2016-08-08 15:00:36.000','2')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090140951','2016-08-08 21:15:00.000','2016-08-08 19:10:51.000','2')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090142330','2016-08-09 23:27:00.000','2016-08-09 19:05:30.000','3')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090143716','2016-08-10 20:14:00.000','2016-08-10 17:50:07.000','4')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090143685','2016-08-10 20:30:00.000','2016-08-10 17:28:19.000','4')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090143741','2016-08-10 20:59:00.000','2016-08-10 18:34:45.000','4')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090143719','2016-08-10 21:30:00.000','2016-08-10 17:59:20.000','4')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090143735','2016-08-10 21:34:00.000','2016-08-10 18:26:36.000','4')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090143866','2016-08-10 22:59:00.000','2016-08-10 21:13:52.000','4')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090143868','2016-08-11 00:19:00.000','2016-08-10 22:00:09.000','5')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090143871','2016-08-11 00:24:00.000','2016-08-10 22:07:28.000','5')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090146675','2016-08-13 18:25:00.000','2016-08-13 16:44:30.000','7')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090146704','2016-08-13 23:10:00.000','2016-08-13 18:34:48.000','7')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090147988','2016-08-15 20:48:00.000','2016-08-15 15:12:15.000','2')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090148287','2016-08-15 23:56:00.000','2016-08-15 19:05:26.000','2')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090148383','2016-08-16 01:19:00.000','2016-08-15 22:39:34.000','3')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090149613','2016-08-17 00:41:00.000','2016-08-16 17:07:59.000','4')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090151067','2016-08-17 19:09:00.000','2016-08-17 16:47:29.000','4')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090151195','2016-08-17 21:37:00.000','2016-08-17 19:08:02.000','4')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090151200','2016-08-17 22:55:00.000','2016-08-17 19:11:32.000','4')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090151333','2016-08-18 00:32:00.000','2016-08-17 21:26:00.000','5')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090153665','2016-08-19 19:45:00.000','2016-08-19 16:15:30.000','6')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090153880','2016-08-20 00:48:00.000','2016-08-19 21:03:11.000','7')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090155707','2016-08-22 23:18:00.000','2016-08-22 16:53:38.000','2')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090155831','2016-08-23 01:39:00.000','2016-08-22 20:05:53.000','3')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090157040','2016-08-23 20:19:00.000','2016-08-23 16:45:35.000','3')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090157208','2016-08-24 03:40:00.000','2016-08-23 20:23:19.000','4')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090158268','2016-08-24 17:51:00.000','2016-08-24 15:26:19.000','4')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090158347','2016-08-24 18:17:00.000','2016-08-24 16:01:42.000','4')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090158277','2016-08-24 20:00:00.000','2016-08-24 15:30:21.000','4')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090158358','2016-08-24 21:15:00.000','2016-08-24 16:08:09.000','4')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090158498','2016-08-24 21:40:00.000','2016-08-24 18:04:41.000','4')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090158506','2016-08-24 22:14:00.000','2016-08-24 18:39:54.000','4')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090158521','2016-08-25 00:13:00.000','2016-08-24 19:39:56.000','5')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090158535','2016-08-25 00:20:00.000','2016-08-24 20:03:41.000','5')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090158581','2016-08-25 02:44:00.000','2016-08-24 22:09:57.000','5')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090159573','2016-08-25 18:10:00.000','2016-08-25 15:17:58.000','5')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090159623','2016-08-25 20:00:00.000','2016-08-25 15:41:27.000','5')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090159786','2016-08-25 20:15:00.000','2016-08-25 17:55:15.000','5')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090159788','2016-08-25 21:15:00.000','2016-08-25 17:59:16.000','5')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090161654','2016-08-28 23:17:00.000','2016-08-28 19:12:54.000','1')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090161687','2016-08-29 00:55:00.000','2016-08-28 20:56:55.000','2')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090162902','2016-08-29 17:20:00.000','2016-08-29 15:49:24.000','2')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090163063','2016-08-29 20:50:00.000','2016-08-29 17:40:44.000','2')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090162941','2016-08-29 21:46:00.000','2016-08-29 16:10:10.000','2')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090163103','2016-08-29 23:23:00.000','2016-08-29 19:15:20.000','2')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090163104','2016-08-29 23:47:00.000','2016-08-29 19:17:47.000','2')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090163178','2016-08-30 00:19:00.000','2016-08-29 21:20:32.000','3')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090163141','2016-08-30 00:45:00.000','2016-08-29 20:16:32.000','3')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090163182','2016-08-30 01:27:00.000','2016-08-29 21:45:13.000','3')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090163185','2016-08-30 02:40:00.000','2016-08-29 21:54:52.000','3')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090164357','2016-08-30 22:00:00.000','2016-08-30 16:55:12.000','3')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090165771','2016-08-31 19:36:00.000','2016-08-31 15:37:08.000','4')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090165950','2016-08-31 21:06:00.000','2016-08-31 17:37:24.000','4')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090166088','2016-08-31 22:31:00.000','2016-08-31 20:24:23.000','4')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090166057','2016-08-31 23:30:00.000','2016-08-31 20:00:03.000','4')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090166124','2016-08-31 23:41:00.000','2016-08-31 21:40:10.000','4')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090166130','2016-08-31 23:41:00.000','2016-08-31 22:26:52.000','4')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090168424','2016-09-02 17:50:00.000','2016-09-02 15:15:43.000','6')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090168574','2016-09-02 20:30:00.000','2016-09-02 16:46:59.000','6')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090168555','2016-09-02 21:15:00.000','2016-09-02 16:34:07.000','6')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090169072','2016-09-03 21:42:00.000','2016-09-03 20:32:16.000','7')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090169083','2016-09-03 23:54:00.000','2016-09-03 22:14:05.000','7')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090169237','2016-09-04 17:30:00.000','2016-09-04 15:14:59.000','1')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090170878','2016-09-06 18:34:00.000','2016-09-06 16:25:07.000','3')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090170801','2016-09-06 19:05:00.000','2016-09-06 15:49:50.000','3')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090171087','2016-09-06 21:23:00.000','2016-09-06 19:55:03.000','3')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090170980','2016-09-06 22:11:00.000','2016-09-06 17:35:13.000','3')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090170995','2016-09-06 22:12:00.000','2016-09-06 18:00:56.000','3')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090171175','2016-09-07 03:37:00.000','2016-09-06 22:52:06.000','4')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090172534','2016-09-07 22:23:00.000','2016-09-07 19:09:46.000','4')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090175200','2016-09-09 19:46:00.000','2016-09-09 16:19:56.000','6')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090175325','2016-09-09 22:33:00.000','2016-09-09 17:49:26.000','6')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090175454','2016-09-09 23:53:00.000','2016-09-09 20:54:02.000','6')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090175354','2016-09-10 00:21:00.000','2016-09-09 18:45:00.000','7')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090175457','2016-09-10 00:53:00.000','2016-09-09 20:59:48.000','7')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090175827','2016-09-10 20:55:00.000','2016-09-10 18:29:54.000','7')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090175867','2016-09-10 23:31:00.000','2016-09-10 21:31:37.000','7')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090176110','2016-09-11 19:52:00.000','2016-09-11 16:28:44.000','1')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090177306','2016-09-12 16:51:00.000','2016-09-12 16:03:23.000','2')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090177321','2016-09-12 20:14:00.000','2016-09-12 16:07:54.000','2')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090177442','2016-09-13 00:25:00.000','2016-09-12 17:20:23.000','3')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090178662','2016-09-13 19:25:00.000','2016-09-13 15:19:00.000','3')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090179056','2016-09-13 22:49:00.000','2016-09-13 20:22:39.000','3')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090180303','2016-09-14 21:29:00.000','2016-09-14 17:59:59.000','4')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090181600','2016-09-15 18:45:00.000','2016-09-15 16:26:24.000','5')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090181678','2016-09-15 19:01:00.000','2016-09-15 17:28:53.000','5')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090181670','2016-09-15 19:50:00.000','2016-09-15 17:22:20.000','5')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090181745','2016-09-15 20:30:00.000','2016-09-15 19:10:18.000','5')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090181813','2016-09-15 21:59:00.000','2016-09-15 20:11:58.000','5')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090181856','2016-09-15 22:42:00.000','2016-09-15 21:26:36.000','5')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090183016','2016-09-16 21:12:00.000','2016-09-16 19:22:10.000','6')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090183040','2016-09-16 22:17:00.000','2016-09-16 20:37:43.000','6')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090183041','2016-09-16 22:27:00.000','2016-09-16 20:40:30.000','6')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090183034','2016-09-16 22:31:00.000','2016-09-16 20:02:30.000','6')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090183052','2016-09-17 00:37:00.000','2016-09-16 21:33:16.000','7')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090185087','2016-09-19 18:10:00.000','2016-09-19 16:29:55.000','2')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090185062','2016-09-19 18:58:00.000','2016-09-19 16:14:18.000','2')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090185245','2016-09-19 21:49:00.000','2016-09-19 19:15:45.000','2')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090186617','2016-09-20 17:48:00.000','2016-09-20 16:45:53.000','3')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090186829','2016-09-20 23:53:00.000','2016-09-20 20:41:08.000','3')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090186846','2016-09-21 02:05:00.000','2016-09-20 21:28:03.000','4')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090188180','2016-09-22 00:16:00.000','2016-09-21 20:00:59.000','5')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090188211','2016-09-22 01:36:00.000','2016-09-21 20:54:58.000','5')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090189513','2016-09-22 20:50:00.000','2016-09-22 17:52:44.000','5')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090189530','2016-09-22 21:01:00.000','2016-09-22 18:09:57.000','5')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090189588','2016-09-22 21:23:00.000','2016-09-22 19:08:55.000','5')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090189542','2016-09-22 21:53:00.000','2016-09-22 18:14:17.000','5')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090189549','2016-09-22 22:18:00.000','2016-09-22 18:21:28.000','5')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090189550','2016-09-22 22:18:00.000','2016-09-22 18:22:30.000','5')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090189553','2016-09-22 22:18:00.000','2016-09-22 18:23:53.000','5')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090190939','2016-09-23 21:42:00.000','2016-09-23 19:42:30.000','6')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090191016','2016-09-24 00:07:00.000','2016-09-23 20:46:16.000','7')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090191072','2016-09-24 04:05:00.000','2016-09-23 22:35:58.000','7')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090191622','2016-09-25 20:33:00.000','2016-09-25 17:07:07.000','1')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090193016','2016-09-26 21:32:00.000','2016-09-26 17:07:42.000','2')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090193115','2016-09-26 23:25:00.000','2016-09-26 19:13:55.000','2')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090193013','2016-09-26 23:45:00.000','2016-09-26 17:05:46.000','2')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090193221','2016-09-26 23:51:00.000','2016-09-26 22:02:02.000','2')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090194344','2016-09-27 15:50:00.000','2016-09-27 15:09:51.000','3')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090194576','2016-09-28 00:01:00.000','2016-09-27 17:29:56.000','4')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090194771','2016-09-28 01:13:00.000','2016-09-27 22:34:01.000','4')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090197363','2016-09-29 18:22:00.000','2016-09-29 15:29:31.000','5')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090197528','2016-09-29 18:42:00.000','2016-09-29 17:08:51.000','5')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090197619','2016-09-29 21:09:00.000','2016-09-29 18:48:10.000','5')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090197582','2016-09-29 21:12:00.000','2016-09-29 18:15:44.000','5')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090197674','2016-09-29 23:45:00.000','2016-09-29 20:23:20.000','5')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090198688','2016-09-30 16:21:00.000','2016-09-30 15:04:07.000','6')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090198736','2016-09-30 16:27:00.000','2016-09-30 15:28:06.000','6')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090198860','2016-09-30 17:38:00.000','2016-09-30 17:01:29.000','6')insert into #Test(AccountNumber, DischargeDateTime, RegistrationDateTime, day_of_week) values('F00090198923','2016-09-30 20:24:00.000','2016-09-30 18:22:42.000','6')[/code]

Summary table for roll-up

$
0
0
Hi, I'm working with a large table (70 mil rows, 100+ columns and growing) used in reports which are slowing down as the table size grows. The data in the table is at the lowest granularity so all calculations happen in real time and take minutes to complete (which means very slow report generation). Not sure why it was designed the way it is (used tableau for 2-3 weeks only) but looking for a way to avoid real-time calculations that take minutes. My gut was to create a summary table and use it as a source. Tested it out aggregated the data to a higher granularity (size went down to 1 mil rows) and with the new source the report query time is down to 1 sec. All good for the base report but works only at the granularity chosen for the summary table and summing up to a higher level(rolling up) results in double counting some records that fall into more than 1 category.Example: 'YEAR' - 'RETAIL CHAIN' - 'STORE' - 'STORE BRANCH' - 'LOCATION' - COUNT(Distinct EmployeeID)In the summary table this returns correct distinct number of Employees per Store Branch (the lowest necessary level), but rolling up to Store or to Retail Chain inflates the counts since employees can work at more than 1 Store Branch or Store. For example, getting the distinct number of employees only for Stores 1, 2 and 3 can't be done by summing up the counts because of possible overlap. How can I aggregate the data in advance in a way that it allows accurate roll up and drill down ( there are lower levels of granularity that are definitely not necessary)?Thanks!SN

WinAuth slower than SQLAuth (SSMS)

$
0
0
WinAuth is much slower than SQLAuth in my SSMS.I am talking about Authentication.With WinAuth it takes 10 seconds - showing Databases (expanding..)How to troubleshoot this ?

How to imbed an image into an email sent by dbmail

$
0
0
Hello all and thank you in advance for your time and expertise.I am sending out customer statements in email using dbmail on sql 2008. I'd like to put our corporate logo on top of the email, but I'm having difficulty doing it. I found an article on the web that showed me how to put html tags into documents (I'm not a programmer, in case you can't tell :-)) and I have this line in my sql statement:<img src="\\waccounting\images\logo.gif" width="400" height="100" border="0"/>When the email goes out, the image is blank on the email. Has anyone been able to put an image into their emails that get sent out by dbmail? If so, how?

Add column value depending on other value in same row

$
0
0
Hi All, I'm working on this for some time but ran into a dead end I'm afraid. So hope to get some help.We have this table with many colums and what I need to do is for every row (record):-get three column values-compare each of those three value again a lookup table-merge the three results from the lookup table together in 1 string-update this row --> insert the string from previous step into another columnThat's it. So on for every row.For now I focussed on the 'read 1 column and update another depending on the value' part. The lookup and string part is the next step and I think I can do that.But I'm not getting this to work. What I tried is:[code="sql"]DECLARE @id NVARCHAR(32)DECLARE @name NVARCHAR(50)DECLARE @loc VARCHAR(50)DECLARE @getid CURSORSET @getid = CURSOR FOR SELECT ExtUserID, LastName, GPF5FROM dbo.SaltoCardholdersOPEN @getidFETCH NEXTFROM @getid INTO @id, @name, @locWHILE @@FETCH_STATUS = 0BEGIN --SELECT @id FETCH NEXT FROM @getid INTO @id, @name, @loc IF @loc = 'VWB' --select @id, @name; UPDATE dbo.SaltoCardholders SET <column_x> = '<some_value>'ENDCLOSE @getidDEALLOCATE @getid[/code]If I uncomment the 'select' and comment the 'UPDATE' I get a good result but with the 'UPDATE' nothing happens (although management studio says a good amount of record have been affected)Maybe I'm going completely in the wrong direction, so anyone out there to help me a bit? Doesn't have to be the path I'm going; as long as it works and it's proper code :)

using MAX is working fine until I add QuantityShipped and then it gives every order and if the order did not have the item it gives 0

$
0
0
I want to solve for every item I have I want to see when a customer last order a item, order id and the qty shipped.when i add the qty shipped I get every order with every item and if that order did not have an item on it I get 0 qty.again I just want to see last order for each item a customer has ever order with the qty[code="sql"]select ompClosedDate,omlSalesOrderID ,omlPartid ,omlQuantityShipped from(SELECT omlSalesOrderID ,omlPartid ,omlQuantityShipped ,max(ompClosedDate) as ompClosedDate FROM SalesOrders LEFT JOIN SalesOrderLines ON omlSalesOrderID = ompSalesOrderID WHERE ompCustomerOrganizationID = '10011' group by omlSalesOrderID ,omlPartid ,omlQuantityShipped ) as ts order by omlPartid[/code]

MAXDOP setting mystery in VM SQL performance .

$
0
0
We have production issue going on , every day we run multiple instances of jobs to process reports . It starts generating reports really slow untill we restart the entire VM which magically improves the performance ( now that did not worked everytime ) . Couple of days ago we discovered resetting the max dop every morning also fixes the perfomance of the query ( 5 times faster) . I am seeking help on which direction to go to find out why its behaving like , 1. Why restting MAXDOP to same number fixes the problem every morning 2. What are factors I should check to confirm that the issue is related to MAXDOP setting 3. Possibility of VM incorrect configuration setup which requires maxdop to reset . SQL 2008 SP3 , 24 Core CPU MAXDOP is 5 .

How to improve the efficiency of a conditional join

$
0
0
If this has been answered before, please point me in the right direction; I'm just not sure what terms I would use to search for this scenario.I have a table that holds freight rates. Pulling the correct rate depends on the value of up to 8 different optional fields. As an example, I'll just use 3 of those fields for readability. Is there a more efficient way to do the following?[code="sql"]SELECT COALESCE(fr1.FreightRate, fr2.FreightRate, fr3.FreightRate, 0)FROM dbo.Sales sLEFT JOIN dbo.FreightRate fr1 ON s.SourceKey = fr1.SourceKey AND s.CompanyKey = fr1.CompanyKey AND s.PackingType = fr1.PackingTypeLEFT JOIN dbo.FreightRate fr2 ON s.SourceKey = fr2.SourceKey AND s.CompanyKey = fr2.CompanyKeyLEFT JOIN dbo.FreightRate fr3 ON s.SourceKey = fr3.SourceKey[/code]I could create a table that blows out FreightRate into every possible combination of values, but that seems like a lot of overhead when there are 8 different variables. There is a hierarchy in place, so I don't have to check the FreightRate table for every possible combination of columns. For example, I don't have to check SourceKey and PackingType together without also including CompanyKey, and I don't have to check CompanyKey on its own.

SQL Server Database mail fails 'a recipient must be specified'

$
0
0
Hi,I'm using SQL Server 2008 R2 SP2 Standard to send email using msdb.dbo.sp_send_dbmail stored procedure, the problem is that sending mail fails with exception 'a recipient must be specified', but querying dbo.sysmail_faileditems I find all items have a recipient specified in the recipients column. Any suggestions?The command I'm using (data isn't real, just in case):--Inside a cursor iteration:EXEC msdb.dbo.sp_send_dbmail@profile_name = 'SomeProfile',@recipients = 'some@mail.com',@subject = 'Subject',@body = 'some html',@body_format = 'HTML';The query to see the error message:select mailitem_id, descriptionfrom dbo.sysmail_logThe result:mailitem_id | description515 | xxx 'a recipient must be specified'The query to see the mail item:select mailitem_id, recipients, sent_statusfrom dbo.sysmail_faileditems;The result:mailitem_id | recipients | sent_status515 | some@mail.com| failedThanks in advance.

Need Suggestion on How to work on Parsename command with dot or decimal?

$
0
0
Hello,I need to divide the fields into four parts. Right now, parsename command is working 95% of my data.Example of the data are separated by the > sign.1. Service > Systems > Solution > Vendor Management2. Insurance > Business > Performance > Version 3.0SQL command to obtain the last part:PARSENAME(REPLACE(field1, ' > ', '.'), 1) When running the query with the select statement, I got the 'Vendor Management' on the first one and the NULL value on the second result.I believe it is due to the value has a 'dot' in there.I tried to search for solutions from this page and I still cannot get it to work.Anyone has suggestions? Thanks.

ranking query with nulls

$
0
0
I have a table[code="sql"]create table temp(Companyid varchar(10) not null,companyname varchar(100) not null,DateFrom datetime not null, DateTo datetime null);INSERT INTO temp values('A1','A Company','2000-04-11',null);INSERT INTO temp values('A1','A1 Company','2000-04-11','2004-12-31');INSERT INTO temp values('A1','A2 Company','2004-12-31',null);[/code]This is Company names database where we Archive change in Company names. As you see from above the first record is an error.There are many such records in the database and I want to rank them and remove them. First we start by DateFrom ASC. We get first two records when we do this. Now I want to rank record if DateTo is Null as RankCompany=2 and if DateTo is not null then RankCompany=1, This is my expected output[code="sql"]create table temp2(Companyid varchar(10) not null,companyname varchar(100) not null,DateFrom datetime not null, DateTo datetime null,RankCompany int);INSERT INTO temp2 values('A1','A Company','2000-04-11',null,2);INSERT INTO temp2 values('A1','A1 Company','2000-04-11','2004-12-31',1);INSERT INTO temp2 values('A1','A2 Company','2004-12-31',null,1);[/code]How can I do thisThanksM

Search string for matching pattern

$
0
0
I thought this would be fairly simple but it has not been. I am using TSQL to search for a string pattern like 'dog.cat' or 'right,wrong' where there is a period in the middle and no numbers or special characters. but my query is not working:I have the following data in my table. Only Sam.Smith and Michael.Jackson should be valid:TESTTEST..TEST.TES.T8Dogn.cat8Dog8.catDog8.catDog@.catttest.TES.TSam.SmithMichael.JacksonCan anybody help me please?

Getting the username of the user from the program into a audittrail

$
0
0
Hi!, I'm getting confused and I would like to ask for help, you see, I have this trigger[code="sql"]alter TRIGGER dbo.SaveUsers ON dbo.employee AFTER UPDATEAS BEGIN -- SET NOCOUNT ON added to prevent extra result sets from -- interfering with SELECT statements. SET NOCOUNT ON; insert into dbo.testaudittrail(userid,userchanged) values (suser_sname(), (select employee_name from deleted))ENDGO[/code]which SHOULD save the username and what the user changed from the system to the database. The problem is suser_sname() returns the username used as your sql login, in my case, its the connection string which all of my systems are attached to, the users does not have any unique login so I cant use this method, and so is SYSTEM_USER and CURRENT_USER. However, I created a users list in my system. I would like to get the username from the users list and save it to the database in my trigger, any head up is welcome.

Importing excel file stored in sharepoint into SQL

$
0
0
I have an excel file that is stored in a sharepoint document library. I am trying to use SSIS to import it into a SQL database. I use the excel connection manager with a sharepoint UNC path. When I run it from BIDS, it runs successfully. When I run it from a job, I get an error"It is already opened exclusively by another user, or you need permission to view and write its data"It is definitely not open by anyone else, and I have full permissions to the file. ALSO, the SQL Agent and Service acct which the job runs under, has full permissions to the file. I have tried running it under a proxy account with my user account, but it fails with the same message. Further, I can run a DIR command from a command prompt to list the sharepoint directory contents successfully, but when I run the same command from SSMS using xp_cmdshell, it fails with access denied. Again, the SQL Service acct has full rights to the sharepoint site. I notice when i browse to the sharepoint document library and try to open the folder with "Open with Windows Explorer", it always asks me to login and I'm thinking that is related to the problem I am having - that it doesn't automatically pick up the windows authentication.Does anyone have any ideas?Thanks

Inaccurate executeion_count(s) in dm_exec_procedure_stats

$
0
0
Hey all, I've been pulling some data on a server we're tuning and one of the things I was looking for was excessive execution of queries, etc... I found a reporting SP that said it was executed over 57,000 times in a < 24 hour period. My first thought was "Oh man, something is really wrong!" So I set up a profiler to look for the RPC Complete on this particular SP, and I wasn't getting anything, but yet the execution_count continued to click up on it. So I went in and actually executed the SSRS report that calls that procedure, and I saw the execution_count tick up *AND* I saw the RPC complete show up in my profiler.So my problem... I no longer can trust the execution_count numbers from this DMV and I really need this data to keep up with this (and other) servers. The number is increasing when the SP is not actually executing, and I've found other instances of this as well on other SP's. I've focused on the reporting ones because those are all interactive or scheduled reports and it is much easier to determine when those were actually run versus the procedures associated to the applications. But if it is happening on these reporting procedures, I have to believe it is happening elsewhere and now all this data is suspect.I found someone else having the same issue on the link below, but my questions for this group:1) Can someone explain what is going on and why it might be doing this?2) Is there a way to fix this or another way I should be getting execution_counts?As a quick sanity check I focused on just the reporting procedures...I queried the DMV and saved the execution countI did a WAITFOR 2 minutesI re-queried the DMV and saved that execution countThen I compared that versus the report execution log in ReportServer.No entries of the report being run, but some of the report counts had increased by 4 to 15 execution counts in that 2 minutes.Any help would be appreciated!Link: https://social.msdn.microsoft.com/Forums/sqlserver/en-US/077cda3b-a126-456a-a899-30c07878cf97/sysdmexecprocedurestats-executioncount?forum=sqltools
Viewing all 16406 articles
Browse latest View live