Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Newbie question on Tinyint type field
Message
De
11/07/2005 11:53:39
 
 
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Autre
Divers
Thread ID:
01031069
Message ID:
01031288
Vues:
18
Dmitry,

Interesting. Yes, I see in BOL where it says that bit data types can not have indexes, and yet I was able to create several indexes on several fields that had the bit datatype in Query Analyzer. I did not get any errors and selecting from the table seems to work fine with no errors.

However, I could not create those indexes in Enterprise Manager (any bit datatypes were not listed in the list of fields when trying to create indexes).

So, I dunno ... weird, huh? <s>

~~Bonnie



>Bonnie,
>
>Is it because bit takes less space to store? I read in a white paper on conversion to SQL Server that the advantage of tinyint is that you can index on it, and bit cannot be indexed. I am not concerned about space, speed of retrieval is more important to me. Unless you had other reasons for suggesting bit type field. Please let me know.
>
>Thank you for your help.
>
>>Dmitry,
>>
>>You may want to consider using bit instead of tinyint for a logical field.
>>
>>~~Bonnie
>>
>>
>>
>>>>
>>>>You can specify DEFAULT for the column to be 0.
>>>
>>>I did it but I did it after the fact. So I know now that I need to do it when creating the field.
>>>
>>>Thank you for your help.
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform