1
Vote

The wizard can't handle a computed field

description

I tried to copy data from on-prem to federated, and i would get errors that my rows were too big, or my datetimes were in the wrong format. As soon as I copied the on-prem table, and dropped the computed column, I could use the wizard. It seems that there should be some way to account for this during the set up steps.

comments

ghuey wrote Nov 3, 2012 at 2:37 AM

Hi,

I believe I see the problem. To say the least, it is not a pretty site. I will fix it as soon as possible.

Thanks for letting me know,
George

ghuey wrote Nov 5, 2012 at 10:57 PM

Hi,

Well, I can't reproduce the problem. Here is one of several tables that had a computed column:

IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[Sales].[SalesOrderDetail]') AND type in (N'U'))
BEGIN
CREATE TABLE [Sales].[SalesOrderDetail](
[SalesOrderID] [int] NOT NULL,
[SalesOrderDetailID] [int] NOT NULL,
[CarrierTrackingNumber] [nvarchar](25) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[OrderQty] [smallint] NOT NULL,
[ProductID] [int] NOT NULL,
[SpecialOfferID] [int] NOT NULL,
[UnitPrice] [money] NOT NULL,
[UnitPriceDiscount] [money] NOT NULL,
[LineTotal]  AS (isnull(([UnitPrice]*((1.0)-[UnitPriceDiscount]))*[OrderQty],(0.0))),
[rowguid] [uniqueidentifier] NOT NULL,
[ModifiedDate] [datetime] NOT NULL,
CONSTRAINT [PK_SalesOrderDetail_SalesOrderID_SalesOrderDetailID] PRIMARY KEY CLUSTERED
(
[SalesOrderID] ASC,
[SalesOrderDetailID] ASC
)WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF)
) FEDERATED ON (OrderID = SalesOrderID)
END

You will notice that LineTotal is a computed column. I was able to create my federation, migrate the schema, create federation members (with SQLAzureMW), and then use SQLAzureFedMW to shard my data. Would it be possible for you to send me the CREATE TABLE statement of the table that is causing your issue? Maybe there is a combination of things that is causing the issue. Also note that it has been awhile since I have updated SQLAzureFedMW with SQLAzureMW. So I updated all of the code as well. You might try pulling down the latest SQLAzureFedMW and try again (just so we can be on the same page).

Sorry for the inconvenience!,
George

slowder wrote Nov 9, 2012 at 1:02 PM

Here's the table's on-prem version:

CREATE TABLE [dbo].[GPSData] (
[GPSID]               BIGINT     NOT NULL,
[FacilityID]          INT        NOT NULL,
[ModemID]             INT        NOT NULL,
[Latitude]            FLOAT (53) NOT NULL,
[Longitude]           FLOAT (53) NOT NULL,
[GeographyDefinition] AS         ([geography]::STPointFromText(((('POINT('+CONVERT([varchar](20),[Longitude],(0)))+' ')+CONVERT([varchar](20),[Latitude],(0)))+')',(4326))),
[Velocity]            FLOAT (53) NULL,
[Direction]           INT        NULL,
[ReceivedDateTime]    DATETIME   DEFAULT (getdate()) NOT NULL,
[GPSDateTime]         DATETIME   NULL,
[SequenceNumber]      INT        NULL,
CONSTRAINT [PK_GPSData__GPSID_FacilityID] PRIMARY KEY CLUSTERED ([GPSID] ASC, [FacilityID] ASC)
);

It's federated on FacilityID. I'll update the wizards later today, and try to push to a copy of that table. I was able to load the table for UAT by streaming it to another copy of the table that dropped the computed column, then selected the data over to the version with the computed column. This wizard is awesome, I'd like to look at some of the methods behind the scenes so we could build a delta process, that way we only send the records that haven't yet been sent, or those that have changed. That way we could schedule the deltas to happen on a regular basis.

ghuey wrote Nov 9, 2012 at 9:55 PM

Thanks for the information. I took your table 100% as you posted and put some data into it. I then created my federation / members and was able to migrate and upload data with no issues. So, I still can't reproduce the problem. Your table looks pretty clean. Out of curiosity, does your database name contain any non alphabetical characters?

Thanks,
George