Viewing 15 posts - 1,351 through 1,365 (of 2,648 total)
Not dynamic, but if you know the values that will appear in item then:
select a.name,
sum(case when b.item = 'red' then...
October 28, 2019 at 9:31 pm
This bit looks odd and long-winded:
AND EXISTS (
SELECT 1
FROM (
SELECT PARTY_ID
FROM C_B_ACCOUNT WITH (NOLOCK)
GROUP BY PARTY_ID
HAVING count(1) = 1
) A
WHERE A.PARTY_ID = ACCT.PARTY_ID
)
I would write it like...
October 28, 2019 at 5:46 pm
It could be that someone is creating large tables for temporary storage in tempdb. I don't see anything wrong with this if they have done it to improve the performance...
October 28, 2019 at 11:47 am
I see your description and your code but I still can't figure out what you're trying to do. Are you simply trying to show what the Thursday week start...
October 25, 2019 at 12:43 pm
You have written a script that if you run it twice you will get a different answer:
SET DATEFIRST 1
DECLARE @dayOfWeek int,
...
October 25, 2019 at 12:00 pm
If you go into menu item Tools/Options, you can change the value from 200 to a different number:

Or if you click the "SQL" button once you have...
October 24, 2019 at 12:22 pm
You haven't shown the query you have written or the results you are getting.
SELECT t1.ID, t1.Name, t2.ValueA, t3.ValueB
FROM Table1 t1
INNER JOIN Table2 t2
...
October 22, 2019 at 7:17 pm
I think you can do the update with a single query, something like this:
;WITH CTE AS
(
SELECT DISTINCT cdi_type,
...
October 21, 2019 at 1:29 pm
Like a visual studio code store?
Like Source control in TFS or GitHub
October 21, 2019 at 1:06 pm
Why the extra step of replacing the concatenated CR and LF? Doesn't replacing the individual CHARs suffice? That's how I've done it, and I'd like to know if there...
October 15, 2019 at 4:15 pm
The statement and what SQL Server does with it are two different things. SQL Server converts the CHOOSE to a bunch of CASEs and RAND() ends up being evaluated...
October 15, 2019 at 9:36 am
But this one doesn't return NULL, so a bit puzzling to me
SELECT CHOOSE((CAST(T.[Rand]* 10 AS INT))%3.00 + 1, 'one', 'two', 'three') Choice,
...
October 14, 2019 at 6:19 pm
But this one doesn't return NULL, so a bit puzzling to me
SELECT CHOOSE((CAST(T.[Rand]* 10 AS INT))%3.00 + 1, 'one', 'two', 'three') Choice,
...
October 12, 2019 at 1:09 pm
From the Microsoft BOL:
Clustered indexes sort and store the data rows in the table or view based on their key values. These are the columns included in the index definition....
October 11, 2019 at 8:44 am
Two single quotes together ('') is evaluated to be the same in an inequality expression as a space character [char(32)].
Couldn't you just use char(9) for your comparison instead of the...
October 10, 2019 at 2:44 pm
Viewing 15 posts - 1,351 through 1,365 (of 2,648 total)