Viewing 15 posts - 601 through 615 (of 4,087 total)
March 18, 2019 at 10:33 am
March 15, 2019 at 4:00 pm
You're thinking procedurally instead of set-based. The tables load all at once, not one row at a time. Look at the OUTPUT clause and study those examples.
Drew
March 15, 2019 at 3:36 pm
March 15, 2019 at 3:25 pm
This gives the results you want. I had to add a little extra code to treat 1 the same as zero.
WITH eventgroups AS
(
SELECT...
March 15, 2019 at 1:32 pm
You're also confused about the meaning of recursion. Recursion is when one CTE refers to itself, not when one query references another. Even if you use a CTE, I see...
March 15, 2019 at 12:26 pm
March 15, 2019 at 11:53 am
maybe this will help
declare @xml as xml = '
<Data>
<Interventions_x0020_Provided>
<Interventions_x0020_Provided_x0020_SubTable>
<Intervention>On-site (Observations, Consultation)</Intervention>
<Provided>true</Provided>
<Minutes>35</Minutes>
<Describe>Completed observation. Discussed...
March 13, 2019 at 10:02 am
It's exactly what it says. There are two matches for itemid = 1, so it doesn't know which record to use in the merge. Given your desired result, you'll want...
March 12, 2019 at 2:50 pm
SELECT FirstName, SecondName, T.MaxPayDate Pay_DateMarch 12, 2019 at 1:18 pm
A view can only consist of a single SELECT statement. You cannot create tables, declare, open, close, deallocate, or fetch from cursors, execute dynamic sql, or declare variables. You may...
March 12, 2019 at 12:26 pm
The purpose of the STUFF() is to remove the very first delimiter when creating delimited strings. You're not delimiting your strings, so you do not need the STUFF().
If...
March 12, 2019 at 10:28 am
Here is another option. This approach probably becomes more attractive as you add more columns to the conditions.
SELECT c.column1, c.column2
FROM table1 a
March 12, 2019 at 10:20 am
There are three options I would suggest. The first two might not be possible if you have constraints on modifying or creating tables.
1) Add a computed column that...
March 12, 2019 at 10:10 am
There's not much to say, since you haven't
a) included your query
b) included the actual execution plan.
It would also help to include table definitions and any views/functions...
March 11, 2019 at 2:01 pm
Viewing 15 posts - 601 through 615 (of 4,087 total)