在大多数情况下,卸载Visual Studio和。NET 4和重新安装它们可以解决。 如果还不解决这个问题,你可以按照下面的步骤来解决此错误: 1。运行命令提示符,然后找到的DLL文件的位置,使用以下命令: DIR Microsoft.SqlServer.Diagnostics.STrace.dll/ S
-- pripravime si temporary tabulku pro manipulaci s cenami, dovolime NULL ID (jinak to cele nebude fungovat)
DROP TEMPORARY TABLE IF EXISTS credit_voucher;
CREATE TEMPORARY TABLE credit_voucher LIKE `pricelist`;
CREATE TEMPORARY TABLE credit_backup_top LIKE `pricelist`;
ALTER TABLE credit_voucher
DROP KEY `PRIMARY`,
CHANGE `id` `id` INT(11) UNSIGNED NULL DEFAULT NULL;
ALTER TABLE credit_backup_top
DROP KEY `PRIMARY`,
CHANGE `id` `id` INT(11) UNSIGNED NULL DEFAULT NULL;
-- vezmeme si aktualni ceny pro 150GB pro CZ i SK, celkem 18
INSERT INTO credit_voucher
SELECT *
FROM pricelist
WHERE
valid_to IS NULL
AND `data_amount` = 150000000
AND `sms_number` IS NULL
AND country IN ('CZ', 'SK'); -- 9x od kazde;
INSERT INTO credit_backup_top
SELECT *
FROM pricelist
WHERE
valid_to IS NULL
AND `data_amount` = 70000000
AND `sms_number` IS NULL
AND is_highlighted = 1
AND country IN ('CZ', 'SK'); -- 9x od kazde;
BEGIN;
-- deaktivujeme puvodni ceny
UPDATE `pricelist`
SET `valid_to` = NOW()
WHERE `id` IN (
SELECT `id`
FROM credit_voucher
);
-- pripravime si kopii puvodnich cen, ktere budou platne od noveho roku
UPDATE credit_voucher
SET id = NULL, archived_id = NULL, valid_to = NULL, valid_from = '2017-01-01 00:00:00';
-- nasypeme pripravene nove ceny do tabulky
INSERT INTO `pricelist`
SELECT *
FROM credit_voucher;
-- pripravime cepickovou polozku
UPDATE credit_voucher
SET valid_from = NOW(), valid_to = '2017-01-01 00:00:00', is_highlighted = 1;
-- zlavime to nam
UPDATE credit_voucher
SET `price` = 18
WHERE `country` = 'SK';
-- aj bratom Čechom
UPDATE credit_voucher
SET `price` = 399
WHERE `country` = 'CZ';
-- nasypeme pripravene nove ceny do tabulky
INSERT INTO `pricelist`
SELECT *
FROM credit_voucher;
-- vytvoreni top polozek pro 70GB od ledna a deaktivace top polozek pro obdobi NOW() - novy rok
-- deaktivujeme puvodni ceny
UPDATE `pricelist`
SET `valid_to` = NOW()
WHERE `id` IN (
SELECT `id`
FROM credit_backup_top
);
-- pripravime si kopii puvodnich cen, ktere budou platne od noveho roku
UPDATE credit_backup_top
SET id = NULL, archived_id = NULL, valid_to = NULL, valid_from = '2017-01-01 00:00:00';
-- nasypeme pripravene nove ceny do tabulky
INSERT INTO `pricelist`
SELECT *
FROM credit_backup_top;
-- nasypeme pripravene nove ceny do tabulky
INSERT INTO `pricelist`
SELECT *
FROM credit_backup_top;
-- udelame z top 70GB polozek obycejne polozky
UPDATE credit_backup_top
SET valid_from = NOW(), valid_to = '2017-01-01 00:00:00', is_highlighted = 0;
-- nasypeme pripravene nove ceny do tabulky
INSERT INTO `pricelist`
SELECT *
FROM credit_backup_top;
-- vsechno se povedlo :)
COMMIT;
-- uklid
DROP TEMPORARY TABLE credit_voucher;