Viewing 15 posts - 3,721 through 3,735 (of 7,609 total)
select
SUM(CASE WHEN TYPE ='D' THEN 1 ELSE 0 END) AS 'TotalXRows',
SUM(CASE WHEN TYPE ='L' THEN 1 ELSE 0 END) AS 'TotalYRows',
SUM(1) AS 'TotalRows'
from dbo.Table with (nolock)
October 3, 2017 at 10:06 am
September 29, 2017 at 3:05 pm
I'm not entirely sure of your intended search rules either, but as best I can tell I think this should get you close:
WHERE ColumnName + '.' LIKE '%[^0-9]1...
September 29, 2017 at 9:00 am
There's a huge difference between with and without a default.
If there's a default value, SQL has to modify metadata and add write that default value to every row...
September 29, 2017 at 7:49 am
I still believe what should have been done, and what could still be done, is that the value should be in its own column.
You can always add columns...
September 28, 2017 at 7:09 am
September 27, 2017 at 2:20 pm
WHERE dbo.LogFile.Created >= DATEADD(month, DATEDIFF(month, 0, @mydate) - 12, 0) AND
dbo.LogFile.Created < DATEADD(day, DATEDIFF(day, 0, DATEADD(month, -12, cast(@mydate AS date))), 0)
Edit: Corrected calc of ending date.
September 27, 2017 at 8:21 am
September 27, 2017 at 7:43 am
September 26, 2017 at 3:15 pm
I think you've got the computed column backwards here.
That is, since the data is supposed to be in 1NF, the "divided by 10" value should be in a...
September 26, 2017 at 2:28 pm
Some refinement is possible. For example, for any single column that has a unique index on it, you wouldn't need to count the values, instead simply get the number of...
September 25, 2017 at 2:54 pm
One of the main reasons to not give VIEW DEFINITION to users is so that they can't see the underlying physical table names. If you let them know the physical...
September 25, 2017 at 10:15 am
Viewing 15 posts - 3,721 through 3,735 (of 7,609 total)