Я работал с Node js и SQL-сервером последние 3 недели, используя все виды операций с базой данных, но когда я пытаюсь обновить слишком много значений столбцов (18 столбцов), это не работает, любой может объяснить, почему это происходит?
Код Node.Js:
new sql.Request(pool1).input('sellerId', sql.VarChar(100), postData.sellerId)
.input('streetNum', sql.VarChar(45), postData.streetNum)
.input('buildingNum', sql.VarChar(45), postData.buildingNum)
.input('apartmentNum', sql.VarChar(45), postData.apartmentNum)
.input('town', sql.VarChar(45), postData.town)
.input('governance', sql.VarChar(45), postData.governance)
.input('floorNum', sql.VarChar(45), postData.floorNum)
.input('poBox', sql.VarChar(45), postData.poBox)
.input('zipCode', sql.Int(), parseInt(postData.zipCode))
.input('creditInfo', sql.VarChar(45), postData.creditInfo)
.query('update Seller set street# = @streetNum, building# = @buildingNum, apartment# = @apartmentNum, town = @town, governance = @governance, floor# = @floorNum, PO_box = @poBox, zip_code = @zipCode, credit_info = @creditInfo where seller_id = @sellerId', (err, result1) => {
if (!err) {
console.log(result1.rowsAffected);
res.json({
updateState: true,
resultt: result1.rowsAffected
});
} else {
console.log(err);
res.json({
updateState: false,
resultt: result.rowsAffected
});
}
});
база данных DDL:
CREATE TABLE Seller(
seller_id varchar(100) not null,
seller_email VARCHAR(45) not null unique,
brand_name VARCHAR(45) NOT NULL unique,
first_name VARCHAR(45) NOT NULL,
last_name VARCHAR(45) NOT NULL,
password VARCHAR(45) NOT NULL,
phone_number VARCHAR(16) NOT NULL,
profile_image varchar(200)NULL,
street# VARCHAR(45) NOT NULL,
building# VARCHAR(45) NOT NULL,
apartment# VARCHAR(45) NULL,
town VARCHAR(45) not NULL,
governance VARCHAR(45) NULL,
floor# VARCHAR(45) NULL,
PO_box VARCHAR(45) NULL,
zip_code int NOT NULL,
credit_info VARCHAR(45) NOT NULL,
PRIMARY KEY (seller_id));
база данных DML:
insert into Seller(seller_id,seller_email,brand_name,first_name,last_name,password
,phone_number,street#,building#,apartment#,town,governance,floor# ,PO_box
,zip_code,credit_info,profile_image)
values('mosta.amer@gmail.com','.IDEA','Mostafa' ,'amer','12345678','0787375793','45p','2','2','moqabalain','Amman', '2' ,'amman/46','123456','visa','https://firebasestorage.googleapis.com/v0/b/ e-commerceasdasdasdasd- c6abd.appspot.com/o/Products%2Fmosta.amer%40gmail.com%2Fic_launcher.png?alt=media&token=41a8db11-42d3-493a-874d-2ef74aba5b74')