Showing posts with label usage. Show all posts
Showing posts with label usage. Show all posts

Thursday, March 22, 2012

Binary field usage in SQL Server

Can anyone point me in the right direction to find documentation for the problem below?
I need to store and retrieve ten fields of 16-bits each for testing 16 true-false conditions (a total of 160 bits in each record) so I think I'd like to use ten 2-byte binary fields (160 "bit" fields would be quite unmanageble, if even possible [I think there is some kind of limit to the number of fields in a single record]).
I'm not quickly finding in the SQL Server's online documentation how to test for, use and update binary fields. I'll keep looking, but can anyone point me in the right direction? I'm using VB, if that makes any difference.

The post below is from SQL Server BOL (books online) documentation on BIT, BINARY and VARBINARY data types. I am assuming you know BIT is proprietry because of three valued logic there is no Boolean data type in ANSI SQL. If you need more information post again. Hope this helps.

bit
Integer data type 1, 0, or NULL.

Remarks
Columns of type bit cannot have indexes on them.

Microsoft? SQL Server? optimizes the storage used for bit columns. If there are 8 or fewer bit columns in a table, the columns are stored as 1 byte. If there are from 9 through 16 bit columns, they are stored as 2 bytes, and so on.

binary and varbinary
Binary data types of either fixed-length (binary) or variable-length (varbinary).

binary [ ( n ) ]

Fixed-length binary data of n bytes. n must be a value from 1 through 8,000. Storage size is n+4 bytes.

varbinary [ ( n ) ]

Variable-length binary data of n bytes. n must be a value from 1 through 8,000. Storage size is the actual length of the data entered + 4 bytes, not n bytes. The data entered can be 0 bytes in length. The SQL-92 synonym for varbinary is binary varying.

Remarks
When n is not specified in a data definition, or variable declaration statement, the default length is 1. When n is not specified with the CAST function, the default length is 30.

Use binary when column data entries are consistent in size.

Use varbinary when column data entries are inconsistent in size.

Thursday, March 8, 2012

BI Dev Studio - export the grid in Dimension Usage tab?

Is anyone aware of a simple way to export the grid (or similar contents) from the Dimension Usage tab in the cube designer?

I imagine it can be done by parsing the XML definition of the cube, but I'm not much of developer with that sort of thing, and I wondered if there's a simple way or a not-so-simple-but-already-written way to get this. I'm not picky about formatting (spreadsheet, text, whatever -- anything but a bitmap screenshot!).

Does anyone else think this would be a handy self documenting feature?

Thanks,

CJB

Keep an eye on http://www.codeplex.com/bidshelper as that feature should be posted within the next week or two. Basically it's going to spit out a print-friendly version of that dimension usage tab.|||I have an early release of this working on my machine at the moment. It prints out using nested groups rather than the matrix that you see in the report usage tab, but most of the info is in there. If you are interested in having a look at an early version contact me via my blog. Otherwise as Greg says, we should have a release out in the next week or two.|||

Thanks, I will keep an eye on that. I poked around on the codeplex projects that you and Mr. Gosbell are working on. I cringed at how much cooler it all is than anything I've put together.

I'm still climbing a .NET learning curve, which wasn't really necessary for me until recently -- as the use of SQL 2005 has begun to mature a bit, and the ease of integrating assemblies into SQL and SSAS has become so slick now, it's too valuable to ignore.