Viewing 15 posts - 1,186 through 1,200 (of 2,648 total)
You could try one of the following hints at the end of the SQL:
OPTION (OPTIMIZE FOR UNKNOWN)
OPTION (RECOMPILE)
January 16, 2020 at 7:48 pm
Given that the table had no index at all, I didn't think in this case that making the clus index unique was necessary, particularly to the extent...
January 16, 2020 at 4:54 pm
Jonathan AC Roberts wrote:I think there are accounting standards that say 4 d.p. should be used for money calculations.
Well, that would depend on your country of operation, wouldn't it?
I don't know,...
January 16, 2020 at 3:37 pm
Well, the issue with MONEY is that who's to say monetary amounts should always have 4 decimals? Often it's too much, and sometimes it's not enough. And if you...
January 16, 2020 at 3:26 pm
To some extent, it gets worse with larger numbers. Try this:
DECLARE @tmp1 FLOAT = 10e27;
SELECT CONVERT(decimal(38,2),ROUND(@tmp1, 2)*100),
CONVERT(decimal(38,2),ROUND(@tmp1, 2))*100,
...
January 16, 2020 at 2:39 pm
Yes, a strange result. Try this:
DECLARE @tmp1 FLOAT = 0.289;
SELECT CONVERT(decimal(38,36),ROUND(@tmp1, 2)*100),
CONVERT(decimal(38,36),ROUND(@tmp1, 2))*100
January 16, 2020 at 2:18 pm
-- drop all user defined stored procedures
Declare @procName varchar(500)
Declare cur Cursor
For Select [name] From sys.objects where type = 'p'
Open cur
Fetch Next...
January 16, 2020 at 11:11 am
Select PP_SUPP.PP_SUP_NO SupplierCode,
PP_SAD.PP_SAD_REF SupplierAddressCode,
GD_CST.GD_CST_FNAME SupplierFullName,
GD_CST.GD_CST_ADD1 SupplierAddressLine1,
...
January 15, 2020 at 6:49 pm
Looks ok to me.
If you want non-integer averages you can do this by adding 0.0 to the count:
with postcount (postid,postcount) as
(
select postid,count(relatedpostid)+0.0 as postcount
...
January 14, 2020 at 2:51 pm
January 14, 2020 at 2:44 pm
The plan looks the same, the estimates are the same, and it even continues to suggest that I create that same index that I just created. (Yes, it's really...
January 13, 2020 at 8:59 pm
What happens if you create the suggested index? Do both queries use it?
January 13, 2020 at 7:58 pm
There is no difference in the execution plan. Just the number of rows estimated.
January 13, 2020 at 7:37 pm
There is quite a lot wrong with your SQL, I've just pasted in something that will work.
drop table [dbo].[Table_1]
GO
drop table [dbo].[Table_2]
GO
CREATE TABLE [dbo].[Table_1](
[KEYU] [int] IDENTITY(1,1) NOT NULL,
[DATA1]...
January 13, 2020 at 7:36 pm
There is no difference in the number of reads, so maybe (as the optimiser is a bit of a black box), in that case, the optimiser doesn't change the order...
January 13, 2020 at 5:34 pm
Viewing 15 posts - 1,186 through 1,200 (of 2,648 total)