Viewing 15 posts - 2,101 through 2,115 (of 2,169 total)
You're welcome!
Now I have to look up "arduous" in my dictionary...
June 13, 2006 at 12:18 am
Max number of columns are restricted to what datatype you use for #Aggregate column. The total size for a row is 8,060 bytes. Using 60 bytes for RowText leaves us...
June 13, 2006 at 12:17 am
Why would you want to have a cursor looping through all records when it almost certainly can be done set-based?
When reading your code, it seems to me that you want...
June 12, 2006 at 2:55 pm
If data are stored as floating point, use
declare @num table (i float)
insert @num
select 134.000 union all
select 1.1200 union all
select 100.00 union all
select 0.0200
select i,
convert(varchar,...
June 12, 2006 at 11:05 am
Even if there are no Cascades deleted, there might still exist triggers!
June 12, 2006 at 10:48 am
Use a derived table, such as
SELECT CompanyID,
Contacted_Date,
FollowUp_Date
FROM MyTable
INNER JOIN (
SELECT CompanyID,
MAX(Contacted_Date) theDate
FROM MyTable
GROUP BY CompanyID
) z ON z.CompanyID = MyTable.CompanyID AND z.theDate = MyTable.Contacted_Date
June 12, 2006 at 10:35 am
So following code will not work?
SELECT web_note_1.CC025_ORG_CODE,
web_note_1.CC025_EXT_ACCT_CODE,
web_note_1.CC025_NOTE_CLASS,
web_note_1.CC025_PROD_CODE
LEFT JOIN TEMP_WEB_NOTES ON TEMP_WEB_NOTES.CC025_ORG_CODE = web_note_1.CC025_ORG_CODE
AND TEMP_WEB_NOTES.CC025_EXT_ACCT_CODE = web_note_1.CC025_EXT_ACCT_CODE
AND TEMP_WEB_NOTES.CC025_NOTE_CLASS = web_note_1.CC025_NOTE_CLASS
AND TEMP_WEB_NOTES.CC025_PROD_CODE = web_note_1.CC025_PROD_CODE
WHERE TEMP_WEB_NOTES.CC025_ORG_CODE IS NULL
GROUP BY web_note_1.CC025_ORG_CODE,
web_note_1.CC025_EXT_ACCT_CODE,
web_note_1.CC025_NOTE_CLASS,
web_note_1.CC025_PROD_CODE
HAVING COUNT(*) > 1
Do you have...
June 12, 2006 at 10:21 am
Yes, SQL injection could possible be an issue here, if the data in ColumnText is written such way.
But since the beginning of the UPDATE-statement is hardwired with "UPDATE", I right now can't see...
June 12, 2006 at 8:01 am
Thanks Ryan.
I have tried to keep the dynamic SQL executions to a minimum for obvious speed reasons. What I think I have provided is a base for creating crosstabs/pivots for...
June 12, 2006 at 7:57 am
Yes, in my very first early version. Then I realized that I could potentially come across the 8000 character limit for varchars.
June 12, 2006 at 7:55 am
Change
UPDATE accountBalance
SET balance = balance - (SELECT debit-credit FROM DELETED)
WHERE code = (SELECT account FROM DELETED)
to
UPDATE accountBalance
SET accountBalance.balance = accountBalance.balance...
June 12, 2006 at 6:45 am
Jeff, any idea why DISTINCT behaved significantly different in times using either clustered/non-clustered index and why GROUP BY didn't change times much?
My gut tells my that a clustered index should...
June 11, 2006 at 5:37 am
You're welcome, Jeff. Too bad I don't have my old computer with me that had SQL2KSP3 installed to compare times with.
June 10, 2006 at 9:30 am
Great script code for testing!
Is there a difference when having index on the table? Clustered/non-clustered? With/without NOLOCK hint?
Running your test-script without any modification, I got following times (50 executions)
2.910-2.976 seconds...
June 10, 2006 at 4:15 am
Viewing 15 posts - 2,101 through 2,115 (of 2,169 total)