Viewing 15 posts - 16 through 30 (of 172 total)
If you had a couple of different sanitized examples it would give a better picture. thx
July 20, 2011 at 11:23 am
While looping through the characters in the row.
Find the first open bracket, do not include any data until you have went past the closing bracket.
Note: if the input is...
July 20, 2011 at 11:18 am
The long and nasty way is to loop through the characters in the data.
Use loops and find first and last '<', '>'.
if < & > are not in the actual...
July 20, 2011 at 11:09 am
Thanks for the heads up. However, disk Partition Alignment are automatic in Win Server 2008.
I actually had an infrastructure colleague who would not perform this alignment on my database servers...
July 20, 2011 at 6:36 am
Thank you all.
sys.databases looks like what the doctored ordered. Including information that will be useful for other areas.
June 29, 2011 at 1:35 pm
Yes,
Instead of doing two sums and then subtracting, the case is setting the credit values to negative and then summing all.
June 20, 2011 at 2:57 pm
The case statement is reversed.
is
SELECT CASE WHEN command = 'Credit' then isnull(trans_amount,0) ELSE -1*
should be
SELECT CASE WHEN command != 'Credit' then isnull(trans_amount,0) ELSE -1*
June 20, 2011 at 2:43 pm
Not sure why smallMoney is failing, however if you replace smallmoney with decimal (10,2) the results look good.
CONVERT(DECIMAL(10,2), sum((trans_amount)/100.00), 0)
The syntax error on the bottom was a missing paren and...
June 20, 2011 at 2:09 pm
My first spot to correct would be the Delete from dbo.Reports in utl_applicationReOccurring. I would guess the query above is returning the same reportID for two of your SqlAgent...
June 17, 2011 at 2:07 pm
I think this line is causing your issue
CONVERT(smallmoney, sum((trans_amount)/100), 0)
try
CONVERT(smallmoney, sum((trans_amount)/100.00), 0)
The value is rounding on the divide before you convert.
BTW: you didn't like the...
June 17, 2011 at 1:33 pm
Without table structure there may be syntax issues. But the code below should work, and be noticeably faster.
SELECT CAST(SUM(trans_amount)/100.00 AS DECIMAL(10,2) settle_amt
FROM
(
SELECT CASE command = 'Credit' then isnull(trans_amount,0) ELSE...
June 17, 2011 at 1:25 pm
One possibility is to create a warehouse type of table that is the structure of your tables with an additional column for the source-table-identifier. Then you could have a...
June 15, 2011 at 8:34 am
Nice article SqlFrenzy!!
I had an in-database index sproc but I like the additional functionality of needed and unused indexes.
I am updating the code to run from a Maintenance type database...
June 10, 2011 at 10:58 am
I would assume it goes here...
select DISTINCT
'http://clientzone.redblock.com/' + w.FullURL as ,
w.Title,
ui.tp_login,
wg.Title,
ud.tp_Created
FROM ...
This assumes the same values for title/tp_login/title/tp_created. If that is not true you could use max() on those...
March 31, 2010 at 11:02 am
Wouldn't
select DISTINCT yourqueryhere
remove your duplicates?
March 31, 2010 at 10:42 am
Viewing 15 posts - 16 through 30 (of 172 total)