Sorensen wrote:
Oh, I forgot that you were working on your own activity, so I was comparing with the statement I received in the Profiler:)
Why does it feel the need to match all fields in the row? Don't you just:
SELECT * FROM EcomOrders WHERE OrderID = 'something'
And then update the dataset? How are your key column definitions on the EcomOrders table?
I'm not really sure what you mean bykey column definitions but maybe this answers your question, here's the "CREATE to" sql for the table.
/****** Object: Table [dbo].[EcomOrders] Script Date: 01/26/2009 12:20:45 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[EcomOrders](
[OrderID] [nvarchar](50) NOT NULL,
[OrderShopID] [nvarchar](255) NULL,
[OrderDate] [datetime] NULL,
[OrderModified] [datetime] NULL,
[OrderComplete] [bit] NULL CONSTRAINT [DF__EcomOrder__Order__355DD6AE] DEFAULT ((0)),
[OrderDeleted] [bit] NULL CONSTRAINT [DF__EcomOrder__Order__3651FAE7] DEFAULT ((0)),
[OrderStateID] [nvarchar](50) NULL,
[OrderVAT] [float] NULL CONSTRAINT [DF__EcomOrder__Order__37461F20] DEFAULT ((0)),
[OrderIP] [nvarchar](255) NULL,
[OrderReferrer] [nvarchar](255) NULL,
[OrderTransactionValue] [nvarchar](2) NULL,
[OrderTransactionType] [nvarchar](50) NULL,
[OrderTransactionStatus] [nvarchar](50) NULL,
[OrderTransactionAmount] [float] NULL CONSTRAINT [DF__EcomOrder__Order__383A4359] DEFAULT ((0)),
[OrderTransactionPayGatewayCode] [nvarchar](4) NULL,
[OrderTrackTraceNumber] [nvarchar](50) NULL,
[OrderShippingMethod] [nvarchar](50) NULL,
[OrderShippingMethodFee] [float] NULL CONSTRAINT [DF__EcomOrder__Order__392E6792] DEFAULT ((0)),
[OrderPaymentMethod] [nvarchar](50) NULL,
[OrderPaymentMethodFee] [float] NULL CONSTRAINT [DF__EcomOrder__Order__3A228BCB] DEFAULT ((0)),
[OrderSalesDiscount] [float] NULL CONSTRAINT [DF__EcomOrder__Order__3B16B004] DEFAULT ((0)),
[OrderCurrencyName] [nvarchar](50) NULL,
[OrderCurrencyRate] [float] NULL CONSTRAINT [DF__EcomOrder__Order__3C0AD43D] DEFAULT ((0)),
[OrderCurrencyCode] [nvarchar](10) NULL,
[OrderCart] [bit] NULL CONSTRAINT [DF__EcomOrder__Order__3CFEF876] DEFAULT ((0)),
[OrderFieldsXML] [nvarchar](max) NULL,
[OrderReSendEmail] [nvarchar](255) NULL,
[OrderCustomerNumber] [nvarchar](255) NULL,
[OrderCustomerCompany] [nvarchar](255) NULL,
[OrderCustomerName] [nvarchar](255) NULL,
[OrderCustomerAddress] [nvarchar](255) NULL,
[OrderCustomerAddress2] [nvarchar](255) NULL,
[OrderCustomerZip] [nvarchar](50) NULL,
[OrderCustomerCity] [nvarchar](255) NULL,
[OrderCustomerCountry] [nvarchar](50) NULL,
[OrderCustomerRegion] [nvarchar](50) NULL,
[OrderCustomerPhone] [nvarchar](50) NULL,
[OrderCustomerFax] [nvarchar](50) NULL,
[OrderCustomerEmail] [nvarchar](50) NULL,
[OrderCustomerCell] [nvarchar](50) NULL,
[OrderCustomerRefID] [nvarchar](255) NULL,
[OrderCustomerEAN] [nvarchar](255) NULL,
[OrderCustomerVatRegNumber] [nvarchar](50) NULL,
[OrderDeliveryCompany] [nvarchar](255) NULL,
[OrderDeliveryName] [nvarchar](255) NULL,
[OrderDeliveryAddress] [nvarchar](255) NULL,
[OrderDeliveryAddress2] [nvarchar](255) NULL,
[OrderDeliveryZip] [nvarchar](50) NULL,
[OrderDeliveryCity] [nvarchar](255) NULL,
[OrderDeliveryCountry] [nvarchar](50) NULL,
[OrderDeliveryRegion] [nvarchar](50) NULL,
[OrderDeliveryPhone] [nvarchar](50) NULL,
[OrderDeliveryFax] [nvarchar](50) NULL,
[OrderDeliveryEmail] [nvarchar](50) NULL,
[OrderDeliveryCell] [nvarchar](50) NULL,
[OrderTotalPrice] [float] NULL CONSTRAINT [DF__EcomOrder__Order__3DF31CAF] DEFAULT ((0)),
[OrderComment] [nvarchar](max) NULL,
[OrderCustomerComment] [nvarchar](max) NULL,
[OrderWeight] [float] NULL,
[OrderVolume] [float] NULL,
[OrderPriceWithVAT] [float] NULL,
[OrderPriceWithoutVAT] [float] NULL,
[OrderPriceVAT] [float] NULL,
[OrderPriceVATPercent] [float] NULL,
[OrderShippingFeeWithVAT] [float] NULL,
[OrderShippingFeeWithoutVAT] [float] NULL,
[OrderShippingFeeVAT] [float] NULL,
[OrderShippingFeeVATPercent] [float] NULL,
[OrderPaymentFeeWithVAT] [float] NULL,
[OrderPaymentFeeWithoutVAT] [float] NULL,
[OrderPaymentFeeVAT] [float] NULL,
[OrderPaymentFeeVATPercent] [float] NULL,
[OrderPriceBeforeFeesWithVAT] [float] NULL,
[OrderPriceBeforeFeesWithoutVAT] [float] NULL,
[OrderPriceBeforeFeesVAT] [float] NULL,
[OrderPriceBeforeFeesVATPercent] [float] NULL,
[OrderCustomerAccessUserID] [int] NULL,
[OrderCustomerAccessUserUserName] [nvarchar](255) NULL,
[OrderShippingMethodID] [nvarchar](50) NULL,
[OrderPaymentMethodID] [nvarchar](50) NULL,
[OrderGatewayResult] [ntext] NULL,
[OrderStepNum] [int] NULL,
[OrderTransactionNumber] [nvarchar](255) NULL,
[OrderCustomerCountryCode] [nvarchar](50) NULL,
[OrderDeliveryCountryCode] [nvarchar](50) NULL,
[OrderStepHistory] [ntext] NULL,
[OrderLanguageID] [nvarchar](25) NULL,
[OrderTransactionMailSend] [bit] NOT NULL DEFAULT ((0)),
[OrderShippingMethodDescription] [nvarchar](max) NULL,
[OrderPaymentMethodDescription] [nvarchar](max) NULL,
[OrderCustomerNewsletterSubcribe] [bit] NOT NULL DEFAULT ((0)),
CONSTRAINT [EcomOrders$PrimaryKey] PRIMARY KEY NONCLUSTERED
(
[OrderID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
ALTER TABLE [dbo].[EcomOrders] WITH NOCHECK ADD CONSTRAINT [EcomOrders$EcomOrderStatesEcomOrders] FOREIGN KEY([OrderStateID])
REFERENCES [dbo].[EcomOrderStates] ([OrderStateID])
ON UPDATE CASCADE
GO
ALTER TABLE [dbo].[EcomOrders] CHECK CONSTRAINT [EcomOrders$EcomOrderStatesEcomOrders]