Viewing 15 posts - 3,721 through 3,735 (of 7,614 total)
October 10, 2017 at 11:46 am
declare @name varchar(10) = 'Server';SELECT TOP (LEN(@name)) SUBSTRING(@name, ROW_NUMBER() OVER(ORDER BY (SELECT NULL)), 1)
FROM sys.all_objects;
This...
October 5, 2017 at 8:03 am
October 4, 2017 at 2:06 pm
Never use ISNULL in a WHERE clause: not only is it unsargable [not relevant in this particular case], but it can also make the code harder to understand. The code...
October 4, 2017 at 1:54 pm
The single most important thing is to do a logical data model before doing a physical database model.
Hints:
1) Google "logical data modeling".
2) Fillfactor, indexes...
October 3, 2017 at 2:42 pm
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
Viewing 15 posts - 3,721 through 3,735 (of 7,614 total)