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)
 Overhead using DEFAULT constraints

Author  Topic 

Bex
Aged Yak Warrior

580 Posts

Posted - 2009-09-18 : 11:52:43
We have an aggregate table. Currently it has no defaults defined. The procedure that inserts into the table sets all the defaults.

Is there additional overhead if I changed the table to have default constraints rather than relying on the proc? If so, would there be a significant hit on performance?

These are the columns below:
(
@TransactionID BIGINT
, @DataLoadSchemaID INT
, @EndTransDateTime DATETIME
, @StoreNo INT
, @POSNo INT
, @TicketNo INT
, @TradingDay NVARCHAR(20)= NULL
, @StartTransDateTime DATETIME = NULL
, @CashierNo INT = NULL
, @TicketAmount INT = 0
, @LoyaltyReentryFlg BIT = 0
, @AccountPaymentFlg BIT = 0
, @TenderExchangeFlg BIT = 0
, @InformationFlg BIT = 0
, @WasteFlg BIT = 0
, @SelfScanFlg BIT = 0
, @RefundCount INT = 0
, @RefundAmount INT = 0
, @VoidCount INT = 0
, @VoidAmount INT = 0
, @LineCount INT = 0
, @RoundNumberRefundCount INT = 0
, @RoundNumberRefundAmount INT = 0
, @GoodwillRefundCount INT = 0
, @GoodwillRefundAmount INT = 0
, @ReductionCount INT = 0
, @ReductionAmount INT = 0
, @ReductionPercentage INT = 0
, @TotalTransactionReductionPercentage INT = 0
, @ReductionOriginalAmount INT = 0
, @TransactionYear SMALLINT = 0
, @TransactionMonth TINYINT = 0
, @TransactionDayOfMonth TINYINT = 0
, @TransactionDayOfWeek TINYINT = 0
, @TransactionWeekNumber TINYINT = 0
, @TransactionHour TINYINT = 0
, @TransactionMinute TINYINT = 0
, @TenderCashCount TINYINT = 0
, @TenderChequeCount TINYINT = 0
, @TenderCreditCardCount TINYINT = 0
, @TenderDebitCardCount TINYINT = 0
, @TenderCouponCount INT = 0
, @TenderStoreCardCount TINYINT = 0
, @TenderFuelCardCount TINYINT = 0
, @TenderGiftCardCount TINYINT = 0
, @TenderVoucherCount INT = 0
, @GiftCardPurchaseCount INT = 0
, @ContainsStaffDiscount BIT = 0
, @ContainsForeignCurrency BIT = 0
, @ContainsChange BIT = 0
, @ContainsTenderVoid BIT = 0
, @ItemQuantityOfZeroFlg BIT = 0
, @LoyaltyFlg BIT = 0
, @TenderCashAmount INT = 0 -- v2.0
, @TenderChequeAmount INT = 0 -- v2.0
, @TenderDebitCardAmount INT = 0 -- v2.0
, @TenderCreditCardAmount INT = 0 -- v2.0
, @TenderStoreCardAmount INT = 0 -- v2.0
, @TenderFuelCardAmount INT = 0 -- v2.0
, @TenderGiftCardAmount INT = 0 -- v2.0
, @TenderCouponAmount INT = 0 -- v2.0
, @TenderVoucherAmount INT = 0 -- v2.0
, @StaffDiscountAmount INT = 0 -- v2.0
, @GiftCardPurchaseAmount INT = 0 -- v2.0
, @CashBackAmount INT = 0 -- v2.0
, @CashBackFlg BIT = 0 -- v2.0
, @HandKeyedRefundCount INT = 0 -- v2.0
, @HandKeyedPaymentCardCount INT = 0 -- v2.0
, @SingleQuantitySaleItemCount INT = 0 -- v2.0
, @NonSingleQuantitySaleItemCount INT = 0 -- v2.0
, @TotalItemScanGapDuration INT = 0 -- v2.0
, @TotalTransactionDuration INT = 0 -- v2.0
, @TotalIdleOrTenderDuration INT = 0 -- v2.0
)


Hearty head pats

Bustaz Kool
Master Smack Fu Yak Hacker

1834 Posts

Posted - 2009-09-18 : 12:30:05
What results did you get when you tried this?

=======================================
Men build too many walls and not enough bridges. -Isaac Newton, philosopher and mathematician (1642-1727)
Go to Top of Page
   

- Advertisement -