I was looking for a way to combine text from multiple rows into a single text column. There are several ways I found to do this but here is a way using FOR XML PATH. First the reason: My source data comes from a transactional DB that users enter text descriptions in multiple transactions. Here is mockup: Text TextFamily TextGroup TextSequence This is a sample text line. C 1 1 This is another line which A 1 1 is followed by the next line that A 1 2 may roll over to the next, but A 1 3 should be r...
Read More
While working on creating some dimension and fact tables I needed to make a change to my date dimension. I went to truncate the table so I could get a fresh reload and received this error message from Management Studio: Cannot truncate table 'DimDate' because it is being referenced by a FOREIGN KEY constraint. The Foreign Key was on my FactPurchase table. This made sense so I removed the constraint and then truncated the table. When I tried to add the constraint back I got this error: Unable to ...
My wife came up with a good explanation to tell people what I do as a BI Consultant. Her explanation was basically that I help companies get their data in a format that helps them make good decisions. It started me to thinking that sometimes we forget what we actually are supposed to be doing when we are working. It has been said that “Discipline is remembering what you are doing.” So I thought I would try to remember and in the remembering maybe help someone else will remember, too. First, what...