SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Using Sparse Columns and Sparse Column Sets


Using Sparse Columns and Sparse Column Sets

Author
Message
Raghavendra Mudugal
Raghavendra Mudugal
SSCrazy
SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)

Group: General Forum Members
Points: 2110 Visits: 2958
Hugo Kornelis (9/5/2012)


This question (the second, chronologically) basically asked which of the insert formats used would fail and which would work.

Yes, from the previous post it has been proved that that insert data been provided here for this question also gets succeeded like the previous one.

The other question (the first, chronologically) used these insert formats to set up sample data and than asked what the effect of a certain statement on that sample data would be. That question is completely different. The sample data could have been given in a variety of other formats without affecting the question.

I apologize if my wording were not consistent.

Now I see the difference here... when i say "same" i didn;t mean the objective of the both are same, i meant the question itself as there is no difference apart from the final select statement where the SELECT INTO is been removed and this question is been changed with some difference in the detail.

So yes, they are different questions. And I think they are both good by themselves. But in combination and in the order they are published here, this (second) question is weak: the same methods of inserting were used for the first question and the rest of that question implied that they would run error-free, so anyone who looked more than casually at that question is bound to get this one right. Had the order been reversed, then both questions would have been good.
Yes, I agree if you are focusing on the objective.

Thank you for your reply. (it is always feels good to interact with experts, not to argue) Smile

ww; Raghu
--
The first and the hardest SQL statement I have wrote- "select * from customers" - and I was happy and felt smart.
(Bob Brown)
(Bob Brown)
SSC Eights!
SSC Eights! (885 reputation)SSC Eights! (885 reputation)SSC Eights! (885 reputation)SSC Eights! (885 reputation)SSC Eights! (885 reputation)SSC Eights! (885 reputation)SSC Eights! (885 reputation)SSC Eights! (885 reputation)

Group: General Forum Members
Points: 885 Visits: 1145
Nice question. I am learning a lot more about SPARSE columns!
sestell1
sestell1
SSCrazy
SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)

Group: General Forum Members
Points: 2557 Visits: 3464
Very interesting, thanks for the question Waynes!
Stephen_W_Dodd
Stephen_W_Dodd
SSC Eights!
SSC Eights! (996 reputation)SSC Eights! (996 reputation)SSC Eights! (996 reputation)SSC Eights! (996 reputation)SSC Eights! (996 reputation)SSC Eights! (996 reputation)SSC Eights! (996 reputation)SSC Eights! (996 reputation)

Group: General Forum Members
Points: 996 Visits: 553
A useful, illustrative question. Thank you, Wayne!
(Bob Brown)
(Bob Brown)
SSC Eights!
SSC Eights! (885 reputation)SSC Eights! (885 reputation)SSC Eights! (885 reputation)SSC Eights! (885 reputation)SSC Eights! (885 reputation)SSC Eights! (885 reputation)SSC Eights! (885 reputation)SSC Eights! (885 reputation)

Group: General Forum Members
Points: 885 Visits: 1145
In researching SPARSE columns, I cannot quite see their value. I'm not that experienced with Sql Server, I wonder how often they are used? Seems examples I have seen look like better database design could have eliminated their necessityUnsure.
Error Handler
Error Handler
Right there with Babe
Right there with Babe (758 reputation)Right there with Babe (758 reputation)Right there with Babe (758 reputation)Right there with Babe (758 reputation)Right there with Babe (758 reputation)Right there with Babe (758 reputation)Right there with Babe (758 reputation)Right there with Babe (758 reputation)

Group: General Forum Members
Points: 758 Visits: 339
Good Question...!

Best,
Naseer Ahmad
SQL Server DBA
Sherwin Anderson
Sherwin Anderson
SSCrazy
SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)

Group: General Forum Members
Points: 2364 Visits: 1419
Good question Wayne learned something about XML Column_Set.
Ken Wymore
Ken Wymore
SSCertifiable
SSCertifiable (5.1K reputation)SSCertifiable (5.1K reputation)SSCertifiable (5.1K reputation)SSCertifiable (5.1K reputation)SSCertifiable (5.1K reputation)SSCertifiable (5.1K reputation)SSCertifiable (5.1K reputation)SSCertifiable (5.1K reputation)

Group: General Forum Members
Points: 5080 Visits: 2376
Nice question. I only got this one right because there was another sparse column question recently that I had to do research on.

I would be interested in seeing a SSC poll on the usage of sparse columns and sets. I have yet to run across any examples of them in production.
(Bob Brown)
(Bob Brown)
SSC Eights!
SSC Eights! (885 reputation)SSC Eights! (885 reputation)SSC Eights! (885 reputation)SSC Eights! (885 reputation)SSC Eights! (885 reputation)SSC Eights! (885 reputation)SSC Eights! (885 reputation)SSC Eights! (885 reputation)

Group: General Forum Members
Points: 885 Visits: 1145
KWymore (9/5/2012)
Nice question. I only got this one right because there was another sparse column question recently that I had to do research on.

I would be interested in seeing a SSC poll on the usage of sparse columns and sets. I have yet to run across any examples of them in production.


I would also like to see how much they are used!!
WayneS
WayneS
SSCrazy Eights
SSCrazy Eights (10K reputation)SSCrazy Eights (10K reputation)SSCrazy Eights (10K reputation)SSCrazy Eights (10K reputation)SSCrazy Eights (10K reputation)SSCrazy Eights (10K reputation)SSCrazy Eights (10K reputation)SSCrazy Eights (10K reputation)

Group: General Forum Members
Points: 9970 Visits: 10573
(Bob Brown) (9/5/2012)
KWymore (9/5/2012)
Nice question. I only got this one right because there was another sparse column question recently that I had to do research on.

I would be interested in seeing a SSC poll on the usage of sparse columns and sets. I have yet to run across any examples of them in production.


I would also like to see how much they are used!!


I guess that one of the easiest examples to give is... Sharepoint.

You can upload a document into it. You can specify various properties of that document. For each type of document, only some of the properties are relevant. As you add more properties to handle more document types, the number of irrelevant columns just increase for each type of document. With potentially an unlimited number to the types of documents, each document will have irrelevant properties... yet they are still being dragged around in the row, and they are taking up space. Unless it's a sparse column, which only takes up space if it has non-null data.

Does this help?

Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
If you can't explain to another person how the code that you're copying from the internet works, then DON'T USE IT on a production system! After all, you will be the one supporting it!
Links: For better assistance in answering your questions, How to ask a question, Performance Problems, Common date/time routines,
CROSS-TABS and PIVOT tables Part 1 & Part 2, Using APPLY Part 1 & Part 2, Splitting Delimited Strings

Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search