新增IIS目录商品图片后,更新数据库图片关联

2017/05/16 14:38:58

--特别说明:具体客户请注意替换cPictureUrl值:http://61.187.98.58:10088

INSERT INTO InventoryPicture

           (cInvCode, cColorCode, pPicture, cPictureUrl, cPictureDesc, cHandle, bDefault, dCreateDate)
SELECT cInvCode, cColorCode ='', pPicture= ''  
, cPictureUrl = 'http://61.187.98.58:10088/Asst/Album/Img/' +cInvCode +'.jpg'
, cPictureDesc = ''
, cHandle = CEILING(rand(checksum(newid()))*100000) 
, bDefault = 0
, dCreateDate = convert(varchar(16),getdate(),120)
FROM  Inventory
WHERE cInvCode NOT IN (SELECT cInvCode FROM InventoryPicture)