Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Storing many differant attributes.

Author  Topic 

Vinnie881
Master Smack Fu Yak Hacker

1231 Posts

Posted - 2010-07-14 : 20:42:43
I am trying to figure out the best way to do this.

I am receiving XML files for 100's of companies. Most share a few of the same attributes (ProductName,Description)

But each company also has up to 70 differant attributes that may send as well that are unique to them. (Color,size,ReferanceName,blah blah)

I get these attributes via individual XML files. If I want to be able to query on these attributes, what is my best method for storing?

I was actually thinking of just saving the XML in the db, and then run a xquery on xml for the nodes I wanted, but that seems like a bad practice. Any sugestions for the best way to accomplish the following.

1. Store EVERY attribute.
2. Quickly be able to query the data in those attributes.

THANKS!



Success is 10% Intelligence, 70% Determination, and 22% Stupidity.
\_/ _/ _/\_/ _/\_/ _/ _/- 881

Sachin.Nand

2937 Posts

Posted - 2010-07-15 : 00:39:54
If you have lot of attributes which can be NULL & also if you are using SQL 2008 then you can have a look at Column sets.

http://msdn.microsoft.com/en-us/library/cc280521.aspx


Limitations live only in our minds. But if we use our imaginations, our possibilities become limitless.

PBUH
Go to Top of Page

Vinnie881
Master Smack Fu Yak Hacker

1231 Posts

Posted - 2010-07-15 : 10:06:38
Ahhh, and the day comes where I have found a feature of sql2008 that makes it worth a upgrade from 2005.

Seems like a good approach.

Thanks!



Success is 10% Intelligence, 70% Determination, and 22% Stupidity.
\_/ _/ _/\_/ _/\_/ _/ _/- 881
Go to Top of Page
   

- Advertisement -