Showing posts with label amount. Show all posts
Showing posts with label amount. Show all posts

Wednesday, March 21, 2012

How to get the amount of bytes exchanged during a Merge replication between 2 MSSQL server

Hi, guys.
A very simple question for all of you: how can I get the amount of
bytes exchanged during a Merge replication between two Microsoft SQL
2000 servers?

Thank you.
Bye,
Angelo.-"Angelo Mariani" <pzgrgr@.hotmail.com> wrote in message
news:d03f5ff7.0407190523.3284dd8a@.posting.google.c om...
> Hi, guys.
> A very simple question for all of you: how can I get the amount of
> bytes exchanged during a Merge replication between two Microsoft SQL
> 2000 servers?
> Thank you.
> Bye,
> Angelo.-

I don't believe there's any API to get this information - you could use
Perfmon to trace the merge agent changes per second, and make an estimate
based on average row size, but that's probably not going to be very
accurate. You may want to post in microsoft.public.sqlserver.replication to
see if you get a better answer.

Simon

Friday, February 24, 2012

How to get last payment made

I need to get the clientid, last payment date, and last payment amount. I have tried using MAX but this does not work. Can anyone see what I'm doing wrong? I get all payments and all dates. I'm summing the payment amount incase they made two payments on the same day, not likely but...

SELECT dbo.tblLoan.Client_ID,MAX(dbo.tblPayments.PaymentDate)AS [Last Pay Date],SUM(dbo.tblPayments.AmountPaid)AS [Last Pay Amt]
FROM dbo.tblLoanINNERJOIN
dbo.tblPaymentsON dbo.tblLoan.Loan_ID = dbo.tblPayments.Loan_ID
GROUP BY dbo.tblLoan.Client_ID
HAVING (dbo.tblLoan.Client_ID = @.Client_ID)

Hi,

You can use "SELECT TOP 1" and "ORDER BY PaymentDate DESC"

Or you can use MAX(PaymentDate) to get the right record using that value in the WHERE clause. You may use CTE to get the code tidy.

|||

SELECT dbo.tblLoan.Client_ID,MAX(dbo.tblPayments.PaymentDate)AS [Last Pay Date],SUM(dbo.tblPayments.AmountPaid)AS [Last Pay Amt]FROM dbo.tblLoanINNERJOIN dbo.tblPaymentsON dbo.tblLoan.Loan_ID = dbo.tblPayments.Loan_IDWHERE (dbo.tblLoan.Client_ID = @.Client_ID)AND dbo.tblPayments.PaymentDate = (SELECT TOP 1 p.PaymentDateFROM dbo.tblPayments pINNERJOIN dbo.tblLoan lON l.Loan_ID = p.Loan_IDWHERE l.Client_ID = @.Client_IDORDER BY p.PaymentDateDESC)GROUP BY dbo.tblLoan.Client_ID
|||

Thank you very much, addie