Viewing 15 posts - 2,521 through 2,535 (of 4,085 total)
CELKO (7/21/2016)
The bit and varying bit datatypes were deprecated in SQL: 2003 for good reasons. You can read some of this: https://www.simple-talk.com/sql/t-sql-programming/bit-of-a-problem/.
Yes, but the SQL standards also have a BOOLEAN...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
July 21, 2016 at 1:02 pm
Sean Lange (7/21/2016)
drew.allen (7/21/2016)
SELECT DISTINCT STUFF(
(SELECT ', ' + t2.Name
FROM #Temp t2
where...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
July 21, 2016 at 11:33 am
Get rid of the ISNULL altogether. FOR XML automatically discards null expressions unless the XSINIL directive is specified.
SELECT DISTINCT STUFF(
(SELECT ', ' + t2.Name
FROM #Temp t2
where t1.ID = t2.ID...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
July 21, 2016 at 9:41 am
It's not clear how these results derive from your sample data: specifically, it's not clear why there are two rows for ER instead of 1, and it's not clear where...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
July 15, 2016 at 12:28 pm
kewlguy13 (7/15/2016)
If I had to design the Junk dimension with these values, what do you suggest.
What would be Junk Dimension structure?
Logic: I was thinking about CROSS...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
July 15, 2016 at 12:21 pm
kewlguy13 (7/15/2016)
Looking at the target table structure, I could see that Cross Join doesn't fit. That's where I was confused.
I will try with the EAV...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
July 15, 2016 at 8:50 am
Jabba1963 (7/15/2016)
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
July 15, 2016 at 8:25 am
Your design is for an EAV table, not a junk dimension. A junk dimension is derived from the Cartesian product of your attributes so it would look more like
JunkID
SubscriptionStatus
CustomerStatus
PaymentDesc
Document
CaseType
TransportedTo
Obviously,...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
July 15, 2016 at 7:59 am
I found a solution that seems to perform very well given certain pre-conditions.
There must be fewer than 31 (or...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
July 14, 2016 at 3:38 pm
You can place your CASE expression in a CTE, derived table, or CROSS/OUTER APPLY and then do the SUM in the main query.
Drew
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
July 13, 2016 at 8:16 am
Because you haven't specified a data type for the value NULL, and it can't figure it out from the value itself, so it assigns a NULL data type. It's...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
July 12, 2016 at 1:22 pm
This is a presentation issue and should be left to the presentation layer.
I am not seeing any strange characters when I run it. XML will entitize CHAR(13) (
), so...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
July 12, 2016 at 11:45 am
cad.delworth (7/12/2016)
drew.allen (7/11/2016)
The reason that you were getting bad results is that your "dates" aren't really dates. They're strings, so they sort alphabetically.
The OP didn't specify the data type...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
July 12, 2016 at 10:31 am
kobi.burkis (7/12/2016)
HiThank you drew.allen for a quick response.
I don't have an aggregate function to apply on the table for pivoting.
You actually do. If you can guarantee a...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
July 12, 2016 at 7:56 am
It sounds like this would help: Cross Tabs and Pivots, Part 1 – Converting Rows to Columns[/url].
Drew
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
July 11, 2016 at 2:42 pm
Viewing 15 posts - 2,521 through 2,535 (of 4,085 total)