Viewing 15 posts - 1,501 through 1,515 (of 2,648 total)
Hi select 100*(24698891)/39552506 i need answer 62.44 How can i reach the requirement? Any suggestion? Thanks in advance
select convert(decimal(9,2),100*(convert(decimal(15,4),24698891))/convert(decimal(15,4),39552506)) Percentage
July 16, 2019 at 1:29 am
I do, however, frequently explain Apply as being an implicit correlated sub-query that's easier to use than many correlated equi-join sub-queries.
I like to think of it as...
July 14, 2019 at 5:02 pm
Emph mine...
ANSI-89 style may have been a standard back in the day, but has long been supplemented. In fact it returns incomplete sets. There used to be a page...
July 13, 2019 at 7:45 pm
SELECT LEFT(SCHID, x.Pos - 1) [Id],
REPLACE(SUBSTRING(SCHID, x.Pos + 1, 8000),',','|') [AdditionalIds]
FROM #X1
CROSS APPLY(VALUES (CHARINDEX(',', SCHID))) x(Pos)
July 11, 2019 at 3:32 pm
I think it actually increases fragmentation, because records are typically added in increasing date order rather than decreasing date order. It improves efficiency, because the index is organised in...
July 11, 2019 at 1:07 am
I've created some test code, not realistic, but the CTE with SELECT TOP(1) is over ten times faster, though has more logical reads.
I also notice that you...
July 10, 2019 at 8:26 pm
I've created some test code, not realistic, but the CTE with SELECT TOP(1) is over ten times faster, though has more logical reads.
set statistics io, time off
set...
July 10, 2019 at 5:10 pm
Hi Michael, The indexes recommended by SQL Server are not always the best, the index you would need to try is:
CREATE NONCLUSTERED INDEX [IX98_SampleData3]
ON [dbo].[SampleData2] (ACC,[Name],[Ref],[DATE]) INCLUDE...
July 10, 2019 at 4:20 pm
Here's a method that doesn't use ROW_NUMBER()
It also requires two scans of the table and is approximately twice as expensive as a result. It will always perform...
July 10, 2019 at 2:26 pm
SELECT [id],
Stuff((SELECT ',' + [VALUE]
...
July 10, 2019 at 1:54 pm
You could be missing some curly brackets from column form_line1.
Try running this to see if there are any invalid values in column form_line1
select f.form_line1
from s1for_formula f
where f.form_line1...
July 10, 2019 at 1:21 pm
If you are doing that many databases, wouldn't you be better off generating a script to create them? Then you'd just need one click to create them all.
July 10, 2019 at 12:50 pm
If you press the left-arrow it goes back to the Databases node.
July 10, 2019 at 12:22 pm
Here's a method that doesn't use ROW_NUMBER()
;WITH CTE AS
(
SELECT DISTINCT SD2.Name,
SD2.ref
...
July 10, 2019 at 12:12 pm
In my experience, the size of the backup is reduced to about 1/6 that of a non-compressed backup.
It does, of course, depend on the contents of your database. If you...
July 9, 2019 at 1:47 pm
Viewing 15 posts - 1,501 through 1,515 (of 2,648 total)