Viewing 15 posts - 4,951 through 4,965 (of 6,036 total)
SELECT C.Chg_code , SUM(R.Amount) as Chg_Amount, COUNT(R.Amount) AS Chg_Count
FROM dbo.ChargeCodesTable C
INNER JOIN dbo.ChargeRecords R ON C.Chg_code = R.Chg_code
GROUP BY C.Chg_code
October 11, 2006 at 10:48 pm
SELECT RecID
FROM Customer A
WHERE TypeID = 'A'
AND EXISTS(select 1 from Customer B
where B.CustID = A.CustID AND B.TypeID <> A.TypeId)
October 11, 2006 at 10:43 pm
Did you notice, it's not them who limited size of their log file.
It just reached the end of hard drive. Nowhere to go anyore.
And you were right, it's BOOOOMMM!!!!
October 11, 2006 at 10:38 pm
If it would not be related I would not ask.
If you would read topic in BOL about Temporary Tables you would not say my question is not related.
October 11, 2006 at 10:33 pm
Where do you create and populate #Temp?
Read about scope of # tables in BOL.
October 11, 2006 at 6:29 pm
Cursors, cross joins, bad table design, dozen of other reasons.
BTW, simple applications give most terrible load on database.
October 11, 2006 at 2:01 pm
I think you must log activity related to SP FROM SP.
And that's the place where you may record the value of your supplied parameter.
If you want to log activity related...
October 11, 2006 at 1:47 pm
You probably don't understand my point.
Tomorrow the guy sitting next to you will manually correct data in the table from EM.
What will happen to your trigger?
What user name will be...
October 11, 2006 at 5:37 am
You may use temp table. It gonna be accessible from trigger.
SELECT @username as WinUser
INTO #CurrentUser
But that's not a way.
Are you sure the table you are trying to audit will be...
October 11, 2006 at 4:47 am
Oh, no...
Everything is even worse!
NEVER JOIN ON DIFFERENT DATATYPE COLUMNS!
It means implicit conversion and full table scan on every query!
Than, replace IN with INNER JOIN.
Your subquery will effectively create...
October 11, 2006 at 3:31 am
Would you mind to look around a little?
There is an answer on your question on the 1st page of this forum and couple of answers on the second page.
Happy browsing.
October 11, 2006 at 2:53 am
OK,
3) Don't ever use VALUES.
SELECT will do the same but it's more capable and more flexible.
In your case it allows to use WHERE NOT EXISTS.
It also allows to...
October 10, 2006 at 11:16 pm
No, it's actually much worse.
I tested my function against 16540 row table.
It returned result in 3..5 seconds (I'm not alone on that server
)
Than...
October 10, 2006 at 7:18 pm
....
INNER JOIN products p on o.SKU COLLATE Latin1_General_CI_AS = p.idProduct COLLATE Latin1_General_CI_AS
BTW, don't use char values as ID's. There are int's for your service.
They must have told you about it, but...
October 10, 2006 at 4:28 pm
Viewing 15 posts - 4,951 through 4,965 (of 6,036 total)