fkierzek wrote:How about a PL/SQL script to generate a random such of data?
I used the following script (for version 2.40). It's not very elegant (just for internal usage) and it doesn't add any attribute mappings. 1 product, 1 variant, 1 category and 1 manufacturer (the most common scenario). Although the number of product tags could be increased to 3-4.
DECLARE @Flag INT
SET @Flag = 1
WHILE (@Flag < 1)
BEGIN
declare @productid int
insert [dbo].[Product]([Name], [ShortDescription], [FullDescription], [AdminComment], [ProductTemplateId], [ShowOnHomePage], [MetaKeywords], [MetaDescription], [MetaTitle], [SeName], [AllowCustomerReviews], [ApprovedRatingSum], [NotApprovedRatingSum], [ApprovedTotalReviews], [NotApprovedTotalReviews], [Published], [Deleted], [CreatedOnUtc], [UpdatedOnUtc])
values ('test' + CONVERT(NVARCHAR(20), @Flag), 'short test description' + CONVERT(NVARCHAR(20), @Flag), 'full test description' + CONVERT(NVARCHAR(20), @Flag), null, 1, 0, null, null, null, null, 1, 0, 0, 0, 0, 1, 0, getutcdate(), getutcdate())
select @productid=scope_identity()
--category
DECLARE @RandomCategoryId int
SELECT @RandomCategoryId = 10 * RAND() + 1
insert [dbo].[Product_Category_Mapping]([ProductId], [CategoryId], [IsFeaturedProduct], [DisplayOrder])
values (@productid, @RandomCategoryId, 0, @RandomCategoryId)
--manufacturer
DECLARE @RandomManufacturerId int
SELECT @RandomManufacturerId = 2 * RAND() + 1
insert [dbo].[Product_Manufacturer_Mapping]([ProductId], [ManufacturerId], [IsFeaturedProduct], [DisplayOrder])
values (@productid, @RandomManufacturerId, 0, @RandomManufacturerId)
--tag
DECLARE @RandomProductTagId int
SELECT @RandomProductTagId = 16 * RAND() + 1
insert [dbo].[Product_ProductTag_Mapping]([ProductTag_Id], [Product_Id])
values (@RandomProductTagId, @productid)
--variant
insert [dbo].[ProductVariant]([ProductId], [Name], [Sku], [Description], [AdminComment], [ManufacturerPartNumber], [Gtin], [IsGiftCard], [GiftCardTypeId], [RequireOtherProducts], [RequiredProductVariantIds], [AutomaticallyAddRequiredProductVariants], [IsDownload], [DownloadId], [UnlimitedDownloads], [MaxNumberOfDownloads], [DownloadExpirationDays], [DownloadActivationTypeId], [HasSampleDownload], [SampleDownloadId], [HasUserAgreement], [UserAgreementText], [IsRecurring], [RecurringCycleLength], [RecurringCyclePeriodId], [RecurringTotalCycles], [IsShipEnabled], [IsFreeShipping], [AdditionalShippingCharge], [IsTaxExempt], [TaxCategoryId], [ManageInventoryMethodId], [StockQuantity], [DisplayStockAvailability], [DisplayStockQuantity], [MinStockQuantity], [LowStockActivityId], [NotifyAdminForQuantityBelow], [BackorderModeId], [AllowBackInStockSubscriptions], [OrderMinimumQuantity], [OrderMaximumQuantity], [DisableBuyButton], [DisableWishlistButton], [CallForPrice], [Price], [OldPrice], [ProductCost], [SpecialPrice], [SpecialPriceStartDateTimeUtc], [SpecialPriceEndDateTimeUtc], [CustomerEntersPrice], [MinimumCustomerEnteredPrice], [MaximumCustomerEnteredPrice], [Weight], [Length], [Width], [Height], [PictureId], [AvailableStartDateTimeUtc], [AvailableEndDateTimeUtc], [Published], [Deleted], [DisplayOrder], [CreatedOnUtc], [UpdatedOnUtc])
values (@productid, null, null, null, null, null, null, 0, 0, 0, null, 0, 0, 0, 0, 0, null, 0, 0, 0, 0,
null, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10000, 0, 0, 0, 0, 1, 0, 0,
1, 10000, 0, 0, 0, @productid, 0, 0, null, null, null, 0, 0, 0, 0, 0, 0, 0, 0, null, null, 1, 0, @productid, getutcdate(), getutcdate())
SET @Flag = @Flag + 1
END
GO
P.S. 10, 2, 16 used in @RandomCategoryId, @RandomManufacturerId, @RandomProductTagId initialization are the maximum available identifiers on my sample database.