SELECTProductCode,Vendor_PartNo,ProductName,DisplayBeginDate,DisplayEndDate,HideProduct,StockStatus,LastModified,Options_Cloned_From,Photos_Cloned_From,Share_StockStatus_With,LastModBy,IsChildOfProductCode,IsChildOfProductCode_ProductID,Options_Cloned_From_ProductID,Photos_Cloned_From_ProductID,Share_StockStatus_With_ProductID,ProductPopularity,HomePage_Section,AutoDropShip,DoNotAllowBackOrders,ProductDescriptionShort,ProductDescription,UPC_code,ProductKeywords,ProductNameShort,ProductWeight,FreeShippingItem,MinQty,MaxQty,RecurringStartPrice,RecurringStartDuration,RecurringPrice,RecurringHowOften,RecurringDuration,AllowPriceEdit,ProductPrice,ListPrice,SalePrice,TaxableProduct,SelectedOptionIDs,GiftWrapCost,(Select top 1 p.ProductName from Products_Joined inner join accessories a on p.productid = a.AccessoryProductIDwhere p.ProductID = a.AccessoryProductID) AS Accessories,DownloadFile,Availability,METATAG_Title,METATAG_Description,DiscountedPrice_Level1,DiscountedPrice_Level2,DiscountedPrice_Level3,DiscountedPrice_Level4,DiscountedPrice_Level5,Photo_SubText,Photo_AltText,DiscountedRecurringPrice_Level1,DiscountedRecurringPrice_Level2,DiscountedRecurringPrice_Level3,DiscountedRecurringPrice_Level4,DiscountedRecurringPrice_Level5,Fixed_ShippingCost,Fixed_ShippingCost_Outside_LocalRegion,Uses_Product_KeyTypes,Price_SubText,Price_SubText_Short,ListPrice_Name,ProductPrice_Name,SalePrice_Name,Hide_YouSave,Hide_FreeAccessories,SetupCost,SetupCost_Name,DiscountedSetupCost_Level1,DiscountedSetupCost_Level2,DiscountedSetupCost_Level3,DiscountedSetupCost_Level4,DiscountedSetupCost_Level5,SetupCost_Title,StockReOrderQty,warehouses,Affiliate_Commissionable_Value,AddtoCartBtn_Replacement_Text,Book_ISBN,ProductCondition,EstShip_Ground,EstShip_2ndDay,EstShip_Overnight,CustomField1,CustomField2,CustomField3,CustomField4,CustomField5,ShoppingDotCom_Category,Yahoo_Category,Yahoo_Medium,ProductManufacturer,Hide_When_OutOfStock,StockLowQtyAlarm,AddToPO_Now,LastPO_Qty,LastPO_Date,HowToGetSalePrice,Inv_Verify_QtyOnHand,Inv_LastVerified,EnableMultiChildAddToCart,Vendor_Price,EnableOptions_InventoryControl,PhotoURL_Small,PhotoURL_Large,Private_Section_Customers_Only,Quickbooks_Item_Accnt,Quickbooks_Item_AssetAccnt,Quickbooks_Item_CogsAccnt,ProductFeatures,TechSpecs,ExtInfo,OrderFinished_Note,METATAG_Keywords,ProductDescription_AbovePricing,CUSTOM_METATAGS_OVERRIDE,ProductCode AS ProductURL,ProductCode AS PhotoURL,(SELECT TOP 1 CategoryID FROM Categories_Products_Link CPL WHERE CPL.ProductID = p.ProductID ORDER BY ID) AS CategoryTree