Viewing 15 posts - 1,696 through 1,710 (of 13,838 total)
Here is a version which includes ordering and your requirement for a count:
DROP TABLE IF EXISTS #Test;
CREATE TABLE #Test
(
person_id INT NOT NULL
...
November 29, 2021 at 10:46 am
If this is a 'from/to' scenario, where ordering is important, you need to add one or more columns to the source data to allow the results to appear in the...
November 29, 2021 at 10:22 am
The filenames are named with the groups there are in - Filename1_Group1.csv, Filename2_Group1.CSV, Filename3_Group1.csv; Filename1_Group2.csv, Filename2_Group2.CSV, Filename3_Group2.csv, and so on
When I create the dataflow task, I add the name...
November 29, 2021 at 9:49 am
Good stuff and totally understood. The only question I have now is how do decide which group any given file is in? I don't know of a reason why...
November 28, 2021 at 10:19 am
What is the problem? Can you be more specific?
November 27, 2021 at 11:54 am
I can't see any easy way of accommodating scenario four in a MERGE, because MERGE does not allow an INSERT in the case of a match.
You could experiment with changing...
November 25, 2021 at 1:23 pm
Sorry my mistake trn.year is decimal. I can not change it. Is it not possible to filter the year in Case statement?
No.
CASE is an expression, which returns a result....
November 25, 2021 at 1:06 pm
The query 'brings all the data' because you are not filtering any of it out. If you wish to filter out data, use a WHERE clause.
I asked you about TrnYear,...
November 25, 2021 at 11:22 am
As an aside, as you're using SS 2019, I suggest you start using STRING_AGG() rather than the legacy FOR XML PATH method.
Makes your code much easier to read.
November 24, 2021 at 2:58 pm
OK, so now you understand why you did not get 'NOTPRIMARY', I assume?
November 24, 2021 at 2:35 pm
StatusId is in dbo.Revision, so I think you'd need to adjust slightly to something like the following
Well spotted, thanks for fixing that up.
November 24, 2021 at 2:33 pm
If you run just the inside part of the query, as follows, what result do you get:
SELECT CASE
...
November 24, 2021 at 1:12 pm
Many thanks for your considered and interesting reply.
I have just run your code and I get the same number of documents exported.
Can we recap on exactly what the problem...
November 24, 2021 at 1:01 pm
Try this:
CREATE TABLE T
(
title VARCHAR(100) NOT NULL
,Computed AS
REPLACE(
...
November 23, 2021 at 3:48 pm
By the way, your query is far easier to read if it is formatted and presented inside a code block, like this:
SELECT DISTINCT
...
November 23, 2021 at 3:30 pm
Viewing 15 posts - 1,696 through 1,710 (of 13,838 total)