Retention Counts

Dec 4, 2007

I have members in a database who have paid thru dates. I am creating retention reports

I created a cross tab in Crystal (using SQL) that counts records that paid within a certain year. I need to create a script that will let me find when members skip payment for a year. Any ideas?

I was thinking of running a count of all paid (Activity) records, but still kind of stuck.

DZ

View 9 Replies


ADVERTISEMENT

Errorlog Retention

Apr 20, 2004

I am trying to change the default number of SQL errorlogs from 6 to 12. Does anyone know how to change that?

View 7 Replies View Related

Distribution Transaction Retention

Nov 6, 2007

I currently have a simple transactional replication setup for a database. My publisher and distributor are on the same box. The subscription is setup using a push agent.

My question is related to recovery of the subscriber.

So lets say replication is setup and working fine. Suddenly we had a failure on the subscriber database. Now I could just reconfigure the subscription, and the subscribing database would be back up and good to go, but the problem is that over time, we have made some changes to the subscribing database that are not made in the publisher. For example, the tables have different indexes. Just reconfiguring the subscritpion would not recover these objects.

So I have to acutally restore the subscriber database. So I do that, and apply transaction logs up to the most recent transaction log backup. Now, consider that my transaction log backups on the subscriber happen every 4 hours, and the most recent transaction log backup I had was from 3 hours ago. So now at this point, my subscribing database is 3 hours behind my publisher.

Now, will the distribution agent resend the missing 3 hours of transactions?

In the distribution agent properties, there are two settings for transaction retention, "at least" and "but not more than". Currently they set to 0 and 72 hours respectivly. Now I would assume that if I set the "at least" setting to the subscriber transaction log backup period, in this case 4 hours, I would be covered, and the distribution agent would indeed re-replication the transactions that happend since the recovery point 3 hours.

I just wanted to verify that this is acutally what these settings are refering too, and that if I set the "at least" setting to 4 hours, I would be covered.

- Eric

View 6 Replies View Related

Which Algorithm Is Better For Customer Retention

Jul 25, 2006

Hi

Pl any one tell me which algorithm is better for Customer retention Using SQL server 2005 analysis services

It will be great if some one can give the same with example of data model with key column , and rest

Thanks in Advance

Rajesh Ladda

View 3 Replies View Related

Transaction Retention - Just How Long Is Best?

Sep 19, 2007

I'm curious what are considerations for choosing a good transaction retention time? The default SQL uses is 0 to 72 hours. With this setting I found that cleanup was taking upwards of 30 minutes (for a process that defaults to run every 10 minutes). I've read that lowering it can improve performance, and that also you don't want this running too long because of deadlock issues between this and the log reader. So how short is too short? Optimally, since the system this runs on is under heavy use I'd like to optimize this as much as possible, which makes me think that the smaller the retention the better, but is something like 1 or 2 hours too short? What are possible consequences of such a short period of time?

View 2 Replies View Related

Backup Data Retention Time?

Nov 12, 2007

I have just started in the scary world of SQL Server admin and am trying to unravel the mysteries of backups etc.
If I run 'BACKUP DATABASE xxx TO DISK = 'D:DB_Backupsxxx.bak' WITH RETAINDAYS = 7' each day, each db backup if appended to the same '.bak' file and the RETAINDAYS protects the backup from being deleted by SQL Server. OK so far. But does anyone understand what criteria is used to decide when to overwrite the older backups? My backup file is getting bigger everyday, with no sign of any of the old data being deleted! Do I have to wait for the entire disk to become full before they start to get overwritten? Or should I just not worry and trust that it will do it all correctly?
Any ideas would be much appreciated.

View 5 Replies View Related

Backup Retention Period Setting

Jul 13, 2006

In sql2005 the database backup retention has been added in sql server properties in database setting.

In 2000 we had a comfortable option to set retention based on maintenance plan,files and also our space availabilty.It has helped the dba's a lot.But it has been removed in sql 2005.

Is that sql server setting is the only retention period setting or do we have to set in anyother tabs..

Thanks



View 6 Replies View Related

Log Shipping History Retention Issue

Sep 11, 2007

I want to change the history retention time because the history stores about 1 gb of detail per database per day in the msdb

Some of the log shipped databases have a monitor server option that has a setting for retention time
but most of the log shipped databases are not using a monitor server since the option was unavailable at setup.

So is there a way to change the history retention time

View 4 Replies View Related

Retention-based Meta Data Cleanup

Apr 18, 2005

Hi

I am running a couple of sql 2000 SP3a servers with merge and snapshot replication. One server acting as publisher and distributor and the rest subscribers. On one of the server I have got the error below and have tried most of the suggestions by msdn. This server has not crashed ever before or any hardware problems. It has been running for a couple of months and no problems. This has not happened no any of the other servers. Any suggestions would be greatly appreciated as the only resolution I have left is to bring up a new instance, setup replication and see if this would resolve the issue. Stopping and starting of agents don't work.


[4/18/2005 11:59:20 AM]BRAAMPDC1ICAS2000.HO_Master: {call sp_MSgetversion }
[4/18/2005 11:59:20 AM]BRAAMPDC1ICAS2000.distribution: {call sp_MShelp_subscriber_info (N'BRAAMPDC1ICAS2000', N'EASTSRV3')}
Connecting to Subscriber 'EASTSRV3.ICASData'

Server: EASTSRV3
DBMS: Microsoft SQL Server
Version: 08.00.0760
user name: dbo
API conformance: 2
SQL conformance: 1
transaction capable: 2
read only: N
identifier quote char: "
non_nullable_columns: 1
owner usage: 31
max table name len: 128
max column name len: 128
need long data len: Y
max columns in table: 1024
max columns in index: 16
max char literal len: 524288
max statement len: 524288
max row size: 524288

[4/18/2005 11:59:27 AM]EASTSRV3.ICASData: {call sp_MSgetversion }
Percent Complete: 2
Connecting to Subscriber 'EASTSRV3'
Percent Complete: 3
Retrieving publication information
Percent Complete: 4
Retrieving subscription information
Percent Complete: 4
The merge process is cleaning up meta data in database 'HO_Master'.
Percent Complete: 4
The merge process cleaned up 0 row(s) in MSmerge_genhistory, 0 row(s) in MSmerge_contents, and 0 row(s) in MSmerge_tombstone.
Percent Complete: 4
The merge process is cleaning up meta data in database 'ICASData'.
The merge process could not perform retention-based meta data cleanup in database 'ICASData'.
Percent Complete: 0
The merge process could not perform retention-based meta data cleanup in database 'ICASData'.
Percent Complete: 0
Category:NULL
Source: Merge Replication Provider
Number: -2147199467
Message: The merge process could not perform retention-based meta data cleanup in database 'ICASData'.
Percent Complete: 0
Category:COMMAND
Source: Failed Command
Number: 0
Message: {call sp_mergemetadataretentioncleanup(?, ?, ?)}
Percent Complete: 0
Category:SQLSERVER
Source: EASTSRV3
Number: 11
Message: General network error. Check your network documentation.

View 1 Replies View Related

SQL 2012 :: Table Property For Retention Date?

Feb 21, 2014

I want to store data warehouse source tables and files in an Archive schema and then delete / drop them after a specified period of time.

Is there a table property that I can set (can't find one) or some other mechanism so that I can easily identify these tables with a script.

If there is no such property or feature within the database engine I will define a metadata table and record it there, but a property or similar that I can set at archive time would be very handy.

View 0 Replies View Related

Transact SQL :: How To Deduct Retention Amount From Arrears Payment

Aug 27, 2015

We have retention policy , and pay at the time year completion , now policy change and it is converted from yearly to monthly and this with effect from April-15. 

if calculate the pay system will generate the Arrear payment of the employee from the month of April  onward but i already paid the retention amount for month for two month April and May which i need to deduct the same otherwise this will double amount .

View 2 Replies View Related

Publication Retention To Increase, How To Avoid Missing Metadata After Cleanup

Mar 29, 2007

I currently use 7 days for subscription expiration setting for my two merge publications, which will cause metadata to clean up very 7 days. Now I need to increase the retention period to be 14 days. How I can avoid missing metadata after cleanup? Microsoft ms151188 (http://msdn2.microsoft.com/en-us/library/ms151188.aspx) warns that publisher may not have enough metadata, which may lead to non-convergence. I want to change this setting without causing any data loss.



Thanks much,

View 1 Replies View Related

Recovery :: How To Perform Server Database Backup Retention Periods

Sep 22, 2015

For the best practice I issued full SQL Server database, differential and transaction log backups.  I have setup a process to backup to local disks and then also copy the files to a centralized set of storage.  On a weekly basis the centralized file system is backed up to a tape backup device. I know I can get data off of the tapes, but that process is time consuming, not well tested from my perspective and I am not in control of the overall process.  Can you offer some recommendations from a SQL Server backup retention perspective?

View 6 Replies View Related

Deadlock: Could Not Perform Retention-based Meta Data Cleanup

Sep 8, 2006

Hi SQL Replication Gurus:

I got some issues in my production environment, so please help me out. The following is the message I got from the replication monitor and I don't what to at this point.

Appreciate you help.

Yong

==========================================================================================

Command attempted:


{call sp_mergemetadataretentioncleanup(?, ?, ?)}

Error messages:


The merge process could not perform retention-based meta data cleanup in database 'TT'. (Source: Merge Replication Provider, Error number: -2147199467)
Get help: http://help/-2147199467

Transaction (Process ID 73) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction. (Source: ply-db-svr1, Error number: 1205)
Get help: http://help/1205

View 8 Replies View Related

Row Counts

Feb 5, 2007

If I right click and browse the properties for the table I can get the value of rows. But for the same table if I do select count(*) from table the value does not match the table properties rows. Please can some one tell me why this is so?

SQL Newbie

View 2 Replies View Related

Counts By Groups

Jan 8, 2007

I expect to get a record below with a count of 0 (and I do), but when I take the comments out (--) of lines 1 & 6 I don't understand why I get no records at all. I need to be able to see all teams in EvalAnswers even if none of the records satisfies the where clause.1 select Count(*) as cnt--, TeamID
2 from EvalAnswers
3 where CoID=@CoID
4 and EvaluatorID=@EvaluatorID
5 and (Scr0=0 and Sugg0 is NULL)
6 --group by TeamID
7

View 4 Replies View Related

Need Help Bracketing Counts

Sep 6, 2007

I need to create a view that shows the number of times that clients made payments, how many clients, and how much they paid over a period of time. I'm not sure if I can use a case for this. How can I put something like this together?
I have a tblClients with a clientid field
I have a tblPayments with the clientid, pmtdate, and pmtamount
For example:
1 Payment ----- 23 Clients ----- $16000
2 Payments ----- 12 Clients ----- $32000
3 Payments ----- 4 Clients ----- $13000
etc...

View 3 Replies View Related

GETTING ROW COUNTS FROM DATABASE

Nov 15, 2000

I need a procedure that will go to a database and give me all the row counts for the user tables.

Does anyone know how I can get this?

Thanks,
Dianne

View 3 Replies View Related

SQL Is Giving Different Row Counts

Apr 20, 2004

Hi,

...giving a very 'summarized' scenario of the problem I have trying to
solve all day (make it 2 days now).

Below are the relevant DDLs... I am not listing the DDLs of my other tables:

CREATE TABLE [SalesFACT] (
[varchar] (10),
[TransDate] [varchar] (10),
[SaleAmt] [float],
[CustCode] [varchar] (10)
. . .
)

I populate the above table via a DTS and have checked and have verified that correct data is coming in... I also have a product master table; for business reasons we can have the same product created with different ProductCodes though the rest of the Product details are EXACTLY the same. We have covered this using a field named 'UniqueProdCode'.

CREATE TABLE ProdMaster(
[ProdCode] [varchar] (10),
[ProdName] [varchar] (35),

[UniqueProdCode] [varchar] (10),

... many other product fields e.g. unit price, category etc...
...
)

First a small Request:
Please note that I have NOT defined links between my tables (in the diagram editor) nor have I defined Primary keys (or any constraint) for any of the tables. When you kindly reply, please suggest I should define primary keys for the tables and also link them in the diagram editor.


[u]THE PROBLEM:
When I do a count(*) query on the table 'SalesFACT', I get the correct number of records.

If I create a view, add table 'SalesFACT' and table ProdMaster, link the
UniqueProdCode field of table 'SalesFACT' with the UniqueProdCode field of ProdMaster (so that I can also get the name, category, etc. for the products in the SalesFACT), and run a count(*) query I get a much higher and incorrect number of rows. The SQL for the view is:


SELECT dbo.SalesFACT.TransDate, dbo.SalesFACT.UniqueProdCode,
dbo.SalesFACT.SaleAmt
FROM dbo.SalesFACT INNER JOIN dbo.ProdMaster ON dbo.SalesFACT.UniqueProdCode = dbo.ProdMaster.UniqueProdCode


Kindly note that I have checked and the contents of the table SalesFACT' UniqueProdCode field DOES contain the correct data i.e. it contains the UniqueProdCode and NOT the ProdCode.

But if i link the "wrong fields", I get the correct count count :confused: i.e. I create a very similar view (as mentioned above) but instead link the UniqueProdCode of table SalesFACT with the ProdCode field (not the UniqueProdCode field) of ProdMaster
table I get the correct count. This is really driving me nuts and I just can't understand what's going on and why the "REVERSE" logic. For your convenience here is the SQL for the 2nd view:


SELECTdbo.SalesFACT.TransDate, dbo.SalesFACT.UniqueProdCode,
dbo.SalesFACT.SaleAmt
FROM dbo.SalesFACT INNER JOIN dbo.ProdMaster ON dbo.SalesFACT.UniqueProdCode = dbo.ProdMaster.ProdCode


Please guide... I have run out of all the things that I could check and thus this SOS and F1

Billions of thansk in advance.

View 2 Replies View Related

How To Do Multiple Counts

Dec 12, 2006

I just inherited an app, where I have two tables that look like this:
[Owners]
--------
Owner
...

[Cases]
-------
Owner
Status
Assigned
...

I need a query to get results that look like this:
[Results]
--------
Owner
# of cases records where Status='Open'
# of cases records Where Status='Pending'
# of cases records WHERE Status<>'Closed' AND Assigned=''

I have one query that works already, but it's using several nested selects. I know I ought to be able to do this using group by instead, and I like to know how.

View 4 Replies View Related

Multiple Counts

Jan 24, 2006

I am creating a database for a soccer league.

I would like to write a query that would give me results in a league table form .

How could I combine different count queries such as:

select hometeam, count(*) as homegames from matches where comp="en1pp" group by hometeam
order by hometeam

select hometeam, count(*) as homewins from matches where homescore>awayscore group by hometeam order by hometeam

into one query giving a three column result homteams, homegames, homewins.

Thanks

View 6 Replies View Related

Do Lots Of COUNTs

Sep 19, 2006

Hello :)

I seem to have somehow got myself into a situation where I'm having to run the following SELECTs, one after another, on a single ASP page. This is not tidy. How can I join them all together so I get a single recordset returned with all my stats in different columns?

SELECT COUNT(*) FROM tblQuiz WHERE [q3] = '5 years +' OR [q3] = '2 - 4 years'
SELECT COUNT(*) FROM tblQuiz WHERE [q4] <> '' AND [q4] IS NOT NULL
SELECT COUNT(*) FROM tblQuiz WHERE [q5] = 'Unhappy'
SELECT COUNT(*) FROM tblQuiz WHERE [q6] = 'Yes'
SELECT COUNT(*) FROM tblQuiz WHERE [q7] = 'Yes'
SELECT COUNT(*) FROM tblQuiz WHERE [q8] <> '' AND [q8] IS NOT NULL

View 8 Replies View Related

Compare Row Counts

Oct 6, 2006

Hi all,

I have a need to compare the number of rows returned from table A when it is joined to table B to the number of rows returned when there are no joins involved. If the number of rows returned are the same, then I need to proceed to execute my next step else end.

So, If RowCount A = RowCount A when A joined to B
THEN Goto Next Step
Else End

I need to put the above logic in a sp that I want to execute using a job.

Help is appreciated.

V

View 5 Replies View Related

Counts On Subquerys

Apr 22, 2004

OK I have a query that bring back a unique identifier and text value
for instance

Select Distinct global_id, Page_url from PageList

global_id page_url
---------- ---------------------------------
4306549 /true/attitudes.htm
1460753 /true/current/answerthis.htm
4303667 /true/current/answerthis.htm
4306549 /true/current/answerthis.htm

Now I want to do a count of the page_url.
Can this be done in one SQL statement using a sub query of some kind

View 6 Replies View Related

Mixing Counts, Min Or Max ?

Nov 28, 2007

Hi I have this

select emailid,
count(emailid) as 'No.of occurences',

FROM tableA
where start_moment between '2007-11-01' and '2007-11-02'
GROUP BY emailid
having (COUNT(emailid) > 1)



Fair enough this returns the emailid along with the amount of times it appears (all greater then 1 .. duplicated in other words)

My question is , there is also a start_moment field in tableA
so i need to get the max or min start_moment along with the above result?

View 3 Replies View Related

Getting Table Counts

Jul 20, 2005

I want to get a resultset of every table in the database, with thecurrent record count of each. What is the easiest way to do this?I can get the list of tables with:Select s.name from sysobjects s where xtype = 'U'each s.name is a table name, but I'm not sure how to join a record countcolumn to the resultset.Thanks,RickN

View 4 Replies View Related

Dividing Counts

Sep 19, 2007

I'm sorry if someone has already posted this but I've looked through a few pages to see if someone had already posted and I couldn't find anything. Anyways, I have two counts and I would like to divide them to get a percentage. Basically I would like to see a percentage of how many tickets are overdue. Here's my SQL:

select count(*)[No. of Tickets Overdue],
case
when sum(datepart(dd,getdate() - j.report_date))>= pt.due_hours then 'Over Due'
when sum(datepart(dd,getdate() - j.report_date))>= pt.due_hours then 'Over Due'
when sum(datepart(dd,getdate() - j.report_date))>= pt.due_hours then 'Over Due'
when sum(datepart(dd,getdate() - j.report_date))>= pt.due_hours then 'Over Due'
end [Ticket Status]
from whd.priority_type pt
inner join whd.job_ticket j on pt.priority_type_id = j.priority_type_id
where j.status_type_id = '1' and j.deleted = '0' and not j.priority_type_id = '5' and not j.priority_type_id = '6'
group by pt.due_hours
order by pt.due_hours desc
COMPUTE SUM(count(*))

select count(*)[Count2]
from whd.job_ticket jt
where jt.status_type_id = '1' and jt.deleted = '0'-- and not jt.priority_type_id = '5' and not jt.priority_type_id = '6'
--COMPUTE [No. of Tickets Overdue]/[Count2]

I know this isn't correct but basically the commented line at the bottom is what I want to do. I've only been doing SQL statements for a few months now, so I know its novice but any help is appreciated.
Thanks in advance.

View 7 Replies View Related

Record Counts

Oct 8, 2006

Hi,

I have 10 databases created. each data base has arround 100 tables . i need to keep track of the number of records in each table of 10 databases and the last modification date on that table. The solution should be programatically by running a T-sql program or any stored procedures or any other but mechinical.

the output should specify the following:

Table #number_of_recs Last_date

database_name.Table_name ###,###,### DD/MM/YY



I will appreciate any assistance in this regard.

thanks,

View 1 Replies View Related

Multiple Counts In A Query

May 20, 2008

I have a table that is linked to other tables in one to many relationship.I have a query using LEFT OUTER JOINs to join the tables together.There are multiple counts in the query and count numbers are messed up.(if there are 4 records from one table and 3 from the other  - it shows 12 as the count)  Your help is appreciated. 

View 2 Replies View Related

Multiple Counts In A Sql Statement

Jan 26, 2004

How would I create a sql statement with 3 or 4 counts which would represent 3 or 4 different columns in a datagrid?

For example

SQL = "SELECT Count(department_id) as "totals1" FROM nonconformance WHERE department_id = '1'"


How would I make additional counts in this SQL statement that looks for when department_id=2 and 3 etc....

Thanks

View 7 Replies View Related

SQL Query For Multiple Counts

Dec 8, 1999

I need to build a table to combine data into a single table but I need it to include a count on more than 1 column. For example, I have a table containing a store number, an isbn, an on hand quantity, and an on order quantity. It's probably easier to explain with an example. I have a source table containing this:

store isbn OnHand OnOrder
===== ========== ====== =======
104 0394572368 2 0
108 0394572368 0 1
109 0394572368 2 0
104 3321695545 2 1
108 3321695545 1 0
109 3321695545 3 1

And I need a table that will combine the isbns and give me sums
and counts like this:

Isbn OnHandLocations OnHandQty OnOrderLocations OnOrderQty
========== =============== ========= ================ ==========
0394572368 2 4 1 1
3321695545 3 6 2 2

Does anyone know of a query that can accomplish this? Thanks in advance.

View 1 Replies View Related

Script For Table Counts

Feb 13, 2006

I need a generic script that will query every table (minus system tables) within a database and generate record counts for each table.

Anybody have a script that will do this ???

Thanks in advance,
Nancy

View 6 Replies View Related

2 Grouped Counts On 1 Table

Oct 10, 2007

I am trying to get a count of a job received date and a job closed date from the same table. I need these counts to be grouped by which team they are for. This is what I have and it isn't working:

SELECT HEAT.dbo.Profile.PrimaryTeamName,
COUNT(CallLog1.RecvdDate) AS OpenCalls,
COUNT(CallLog2.ClosedDate) AS ClosedCalls
FROM HEAT.dbo.Profile,
HEAT.dbo.CallLog CallLog1,
HEAT.dbo.CallLog CallLog2
WHERE HEAT.dbo.Profile.CustID = CallLog1.CustID AND
HEAT.dbo.Profile.CustID = CallLog2.CustID AND
CallLog1.CallID = CallLog2.CallID AND
((HEAT.dbo.Profile.PrimarySupportGroupID = 'ATS') OR
(HEAT.dbo.Profile.PrimarySupportGroupID = 'ats'))
GROUP BY HEAT.dbo.Profile.PrimaryTeamName,
CallLog1.RecvdDate,
CallLog2.ClosedDate
HAVING (CallLog1.RecvdDate = CONVERT([VARCHAR](10), GETDATE(), 120)) OR
(CallLog2.ClosedDate = CONVERT([VARCHAR](10), GETDATE(), 120))

I can get both counts to work individually, but as soon as I try to get them to go together I get some very interesting returns. I am drawing a complete blank as to what to do. Any info would be very helpful.

Thanks

View 5 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved