June 11, 2014 at 2:32 pm
So I have two tables with similar columns etc, unfortunately the Insert to the History table fails. I apologize for the formatting, no sure how to format.
Source Table.
CREATE TABLE [dbo].[SKUCURRENT](
[UID] [int] IDENTITY(1,1) NOT NULL,
[SKU] [nvarchar](100) NOT NULL,
[WHSELOC] [nvarchar](50) NOT NULL,
[WEIGHT] [nvarchar](50) NOT NULL,
[BOXCODE] [nvarchar](1) NOT NULL,
[Seller Cost] [float] NULL,
[Unit Weight] [nvarchar](255) NULL,
[UPC] [nvarchar](255) NULL,
[vendor] [nvarchar](255) NULL,
[FAMILY] [nvarchar](255) NULL,
[CATEGORY] [nvarchar](255) NULL,
[LISTING FEE] [float] NULL,
[ACTIVE] [nvarchar](255) NULL,
[shipping cost domestic] [float] NULL,
[shipping charge domestic] [float] NULL,
[shipping cost (HI AK PR)] [float] NULL,
[shipping charge (HI AK PR)] [float] NULL,
[shipping cost (CANADA)] [float] NULL,
[shipping charge(CANADA)] [float] NULL,
[shipping cost INTL] [float] NULL,
[shipping charge INTL] [float] NULL,
[shipping cost domestic EXPRESS] [float] NULL,
[wholesale shipping cost domestic] [float] NULL,
[wholesale shipping cost (HI AK PR)] [float] NULL,
[wholesale shipping cost (CANADA)] [float] NULL,
[wholesale shipping cost INTL] [float] NULL,
[wholesale shipping cost domestic EXPRESS] [float] NULL,
[dropship 3rdparty ship cost] [float] NULL,
[dropshipCharge-domestic-ground-alone] [float] NULL,
[dropshipCharge-domestic-ground-with] [float] NULL,
[dummy] [int] NULL,
[upsize_ts] [nvarchar](50) NULL,
[BEGDT] [datetime] NULL,
[ENDDT] [datetime] NULL,
[USERNAME] [nvarchar](255) NULL
) ON [PRIMARY]
Destination
CREATE TABLE [dbo].[SKUHISTORY](
[SKU] [nvarchar](255) NULL,
[WHSELOC] [nvarchar](255) NULL,
[WEIGHT] [nvarchar](50) NOT NULL,
[BOXCODE] [nvarchar](255) NULL,
[Seller Cost] [float] NULL,
[Unit Weight] [nvarchar](255) NULL,
[UPC] [nvarchar](255) NULL,
[vendor] [nvarchar](255) NULL,
[FAMILY] [nvarchar](255) NULL,
[CATEGORY] [nvarchar](255) NULL,
[LISTING FEE] [float] NULL,
[ACTIVE] [nvarchar](255) NULL,
[shipping cost domestic] [float] NULL,
[shipping charge domestic] [float] NULL,
[shipping cost (HI AK PR)] [float] NULL,
[shipping charge (HI AK PR)] [float] NULL,
[shipping cost (CANADA)] [float] NULL,
[shipping charge(CANADA)] [float] NULL,
[shipping cost INTL] [float] NULL,
[shipping charge INTL] [float] NULL,
[shipping cost domestic EXPRESS] [float] NULL,
[wholesale shipping cost domestic] [float] NULL,
[wholesale shipping cost (HI AK PR)] [float] NULL,
[wholesale shipping cost (CANADA)] [float] NULL,
[wholesale shipping cost INTL] [float] NULL,
[wholesale shipping cost domestic EXPRESS] [float] NULL,
[dropship 3rdparty ship cost] [float] NULL,
[dropshipCharge-domestic-ground-alone] [float] NULL,
[dropshipCharge-domestic-ground-with] [float] NULL,
[BEGDT] [datetime] NULL,
[ENDDT] [datetime2](3) NULL,
[USERNAME] [nvarchar](255) NULL
) ON [PRIMARY]
INSERT THAT Fails:
INSERT INTO dbo.SKUHISTORY SELECT [SKU],[Seller Cost],[WEIGHT],[Unit Weight],[UPC],[vendor],[FAMILY],[CATEGORY],[LISTING FEE],[ACTIVE],[shipping cost domestic],[shipping charge domestic],[shipping cost (HI AK PR)],[shipping charge (HI AK PR)],[shipping cost (CANADA)],[shipping charge(CANADA)],[shipping cost INTL],[shipping charge INTL],[shipping cost domestic EXPRESS],[wholesale shipping cost domestic],[wholesale shipping cost (HI AK PR)],[wholesale shipping cost (CANADA)],[wholesale shipping cost INTL],[wholesale shipping cost domestic EXPRESS],[dropship 3rdparty ship cost],[dropshipCharge-domestic-ground-alone],[dropshipCharge-domestic-ground-with],[BOXCODE],[WHSELOC],[BEGDT],[ENDDT],[USERNAME] FROM dbo.SKUCURRENT
Sample Data
SKUWHSELOCWEIGHTBOXCODESeller CostUnit WeightUPCvendorFAMILYCATEGORYLISTING FEEACTIVEshipping cost domesticshipping charge domesticshipping cost (HI AK PR)shipping charge (HI AK PR)shipping cost (CANADA)shipping charge(CANADA)shipping cost INTLshipping charge INTLshipping cost domestic EXPRESSwholesale shipping cost domesticwholesale shipping cost (HI AK PR)wholesale shipping cost (CANADA)wholesale shipping cost INTLwholesale shipping cost domestic EXPRESSdropship 3rdparty ship costdropshipCharge-domestic-ground-alonedropshipCharge-domestic-ground-withBEGDTENDDTUSERNAME
Turtle-Q-340.275LB846480010739VanburstTurtleQ-30Y7013.031823.5331.9539.1131.9525.487.22110.6514.912101313D90E2013-01-01 00:00:00.000NULLADMINISTRATOR
Turtle-Tod34.144LB846480010715VanburstInactiveInactive0Y7012.341822.131.9535.6231.9525.484.816.717.9111.8116.7101313B90E2013-01-01 00:00:00.000NULLADMINISTRATOR
Turtle-Twin-444.365LB846480010722VanburstInactiveInactive0Y7.5013.031823.5331.9539.1131.9525.487.22110.6514.912101313D90E2013-01-01 00:00:00.000NULLADMINISTRATOR
Any Ideas would really help.
Thanks
June 11, 2014 at 2:51 pm
Sorry I figured out what the issue is. It was stupid transaction issue.
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply