Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
D

dokmanov

@dokmanov
About
Posts
1
Topics
0
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Help with SQL Server (NOT A programming question) [modified]
    D dokmanov

    One consideration may be indexability of the bit vs. char field. I don't believe SQL Sever allows indexing of bit fields, but char fields ma be indexed. Howeever, I think that if the SQL Engine determines that there are there are very few distinct values in the database, it will end up doing a table scan anyways. This may be why bit fields are not indexable, since there are only two values. Spare me the flames if you are tempted, I know I just skimming some ideas. My question to you guys wouldbe, "How does one efficiently index a table on a bit field?" Perhaps the bit field is called "ActiveFlag" and we want to indetifiy the small percentage of active records. I expect someone would say to create another table, but there is a lot of admin and programming overhead to manage another identical table. I have conidered created another table just to store the PKs of the original table's records that are active and done a join to that small table to identify the active records. Any thoughts on all of this? I've also heard arguments to avoid using the bit data type because it is not std and therefore there wouldbe a higher conversion cost should the app be converted to Oracle, for example, which does not support bit fields. I think Oracle people tend to use the char 1 Y/N approach although our DBA doesn't even add a "Y or N only" constraint because it would "slow down the database". BY a micro hair, I bet, at the cost of increased integrity risk. Personally, my experience tells me that the highest cost occurs from the database getting invalid data put into it. As a result, I always select my data types as narrow as possible and use constraints to ensure integrity. The Constraint part is not favored by our DBAs. I also like to use FKs, but our DBAs reject them for performnce reasons, too. That, I can understand a little better but I still feel that FKs make up for it with increase data integrity, it helps to self document the database and it helps in graphical query construction by automatically adding joins. comments are encouraged.

    The Lounge csharp database wpf question sql-server
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups