Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Head-breaking query
Message
 
 
À
21/09/2016 08:27:09
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Divers
Thread ID:
01641137
Message ID:
01641167
Vues:
43
>>What is the query you tried? By the way, decimal (1,0) has no sense. You should have used tinyint instead. Also, why all columns are nullable? What is the primary key for the table? Can you have NULL in StoreCode and in DayNumber columns?
>>
>
>I understand your point in general, but the "decimal(1,0) has no sense" isn't entirely accurate. Assuming that was being used for the numeric day of week (1-7) , it "will" work, though I admit that's the first time I think I've ever seen that.
>
>Yes, a tinyint (and a constraint of values 1-7) is definitely preferable, but I wouldn't say "decimal (1,0) has no sense".
>
>(Well, to make a bad pun, it's true that decimal(1,) has no "cents" ) :)

That table structure looks to me as it was most likely converted from original VFP table and never changed for SQL Server. All nullable columns and decimal(1,0) columns tell that.

If there is a chance, I suggest to re-think the database model for the application. If that table is only used for initial loading of the data from another source, then it's fine. If that table is used for daily transactions, then it may be a good idea to at least fix its structure.
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform