Viewing 15 posts - 1,081 through 1,095 (of 7,608 total)
Yes, agree that it would benefit in the read loads. But we should also consider the overhead of CI on write operations. So if the database is read-intensive...
December 21, 2021 at 7:30 pm
It really depends on whether you understand the consequences of NOLOCK. It can result in a 'dirty read' if there are uncomitted transactions in the database that affect the...
December 21, 2021 at 7:02 pm
Probably this?!:
;WITH Cte_Test_With_Row_Nums AS (
SELECT *,
ROW_NUMBER() OVER(PARTITION BY UserID, Schedule_Start_Date ORDER BY Start_Time) AS row_num
...
December 17, 2021 at 6:45 pm
Once you assign an alias to a table, that alias is the only valid way to reference that table. That's not a matter of preference or opinion. It's...
December 17, 2021 at 1:35 am
You have to understand... I don't actually care what the question was. This isn't stack overflow. I was teaching about the proper forms and you don't need a FROM...
December 16, 2021 at 9:39 pm
There is no need for the FROM clause in the first example.
I also prefer the second example because it's easy to change it to a SELECT to...
December 16, 2021 at 8:17 pm
Once you assign an alias to a table, that alias is the only valid way to reference that table. That's not a matter of preference or opinion. It's a SQL...
December 16, 2021 at 7:28 pm
There is no need for the FROM clause in the first example.
I also prefer the second example because it's easy to change it to a SELECT to see what...
December 16, 2021 at 7:26 pm
Within other quotes, you have to double up the single quotes around the date, like so:
SET @Where = @Where + ' T0.U_DATE BETWEEN ''20210301'' and ''20210331'' '
December 16, 2021 at 5:36 pm
For doing single row lookups, a nonclustered index (NI) on a heap is no worse performance than a clustered index (CI). However, as Grant noted, SQL does truly prefer CIs.
If...
December 16, 2021 at 4:23 pm
IF you want to extract the value after 'number="' in the string:
SELECT *,
SUBSTRING(string, NULLIF(CHARINDEX('number="', string), 0) + 8,
...
December 16, 2021 at 12:31 am
No sample data, so unable to test. You might have to include DATENAME(WEEKDAY, CA1.[Start Time]) in the GROUP BY, but I don't think that's required. I can't remember for sure...
December 15, 2021 at 9:09 pm
"I review it". How long does THAT take?
And why does it need reviewed for "safety" if they don't have the permissions to change anything...
December 14, 2021 at 9:30 pm
Viewing 15 posts - 1,081 through 1,095 (of 7,608 total)