Viewing 15 posts - 1,171 through 1,185 (of 7,614 total)
If I understand correctly, you just need to add the condition on the JOIN:
...previous_part_of_query_same_as_before...
INNER JOIN #temp_Lookback t2 ON t1.Id = t2.PreviouslyCompletedId AND t2.Type = 'F'
November 2, 2021 at 3:29 pm
You'd typically want to use dynamic SQL for this, so that only the relevant columns were included in the comparisons. You'll also typically want to recompile to get a specific...
November 2, 2021 at 3:22 pm
It definitely could, esp. if there's an index containing the type column.
November 1, 2021 at 5:58 pm
First try refreshing the view. The "*" in the view may be causing some issues if the table has changed after the view was created.
November 1, 2021 at 4:59 pm
I'd say it depends on how often you need to show the resolution duration. That's a rather complex calc to do repeatedly..
I have to disagree. If you use...
November 1, 2021 at 4:58 pm
I'd say it depends on how often you need to show the resolution duration. That's a rather complex calc to do repeatedly. And presumably the Resolution Time would only be...
November 1, 2021 at 3:17 pm
Sorry.
SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
GO
CREATE FUNCTION [dbo].[DelimitedSplit8K] (
@pString varchar(8000),
@pDelimiter char(1)
)
RETURNS TABLE WITH SCHEMABINDING
AS
/*SELECT *...
October 29, 2021 at 8:04 pm
A few other things need changed to match SQL Server syntax as well.
CREATE TABLE "circuits" (
"circuitId" int NOT NULL IDENTITY(1, 1), --<<--
"circuitRef" varchar(255)...
October 29, 2021 at 7:04 pm
Let's fall back on the old reliable dbo.DelimitedSplit8K function, to avoid doing all the parsing ourselves.
;WITH sample_data AS (
SELECT * FROM ( VALUES
...
October 29, 2021 at 6:56 pm
UPDATE ...
SET FirstName = PARSENAME(LEFT(EmailAddress, CHARINDEX('@', EmailAddress) - 1), 1),
LastName = PARSENAME(LEFT(EmailAddress, CHARINDEX('@', EmailAddress) - 1), 2)
October 28, 2021 at 2:49 pm
Yes to the most RAM you can get and actually use for SQL Server: 128GB for Standard Edition, as much as you can afford for Enterprise.
Note that, if Standard Ed,...
October 27, 2021 at 7:56 pm
You can write them to a table -- add an identity for ordering -- and then SELECT from that table, for example:
SELECT sql_text AS [--sql_to_run]
FROM #some_table_name
ORDER BY $IDENTITY
October 27, 2021 at 6:54 pm
You didn't say what the result should be if it is tied, for example, 2F and 2M? In that case, I went with 'FemaleMix', adjust that if you need to.
October 27, 2021 at 6:14 pm
You need to change the Options..., Query Results, SQL Server in your SSMS to display more chars.
You don't need (nor likely want) to toggle to text. A grid display should...
October 27, 2021 at 6:04 pm
My first suggestion would be to use SELECT rather than PRINT, since SELECT goes up to 65535 chars (I believe, if you have the options set that way in SSMS).
October 27, 2021 at 2:29 pm
Viewing 15 posts - 1,171 through 1,185 (of 7,614 total)