Я пытаюсь сделать вставку в мою таблицу:
CREATE TABLE "FittingOldSystem" (
"fittingOldSystemId" INT NOT NULL,
"name" VARCHAR(300) NULL DEFAULT NULL,
"address_1" VARCHAR(300) NULL DEFAULT NULL,
"add_2" VARCHAR(300) NULL DEFAULT NULL,
"add_3" VARCHAR(300) NULL DEFAULT NULL,
"add_4" VARCHAR(300) NULL DEFAULT NULL,
"add_5" VARCHAR(300) NULL DEFAULT NULL,
"county" VARCHAR(50) NULL DEFAULT NULL,
"date" DATETIME NULL DEFAULT NULL,
"order_no" VARCHAR(30) NULL DEFAULT NULL,
"phone" VARCHAR(20) NULL DEFAULT NULL,
"rep" VARCHAR(10) NULL DEFAULT NULL,
"house_no" VARCHAR(10) NULL DEFAULT NULL,
"fit_date" DATE NULL DEFAULT NULL,
"fitters" VARCHAR(10) NULL DEFAULT NULL,
"type" VARCHAR(10) NULL DEFAULT NULL,
"site_add1" VARCHAR(300) NULL DEFAULT NULL,
"site_add2" VARCHAR(300) NULL DEFAULT NULL,
"site_add3" VARCHAR(300) NULL DEFAULT NULL,
"site_add4" VARCHAR(300) NULL DEFAULT NULL,
"site_add5" VARCHAR(300) NULL DEFAULT NULL,
"fullAddress" VARCHAR(1000) NULL DEFAULT NULL,
"cus_comm_1" TEXT NULL DEFAULT NULL,
"telno_h" VARCHAR(50) NULL DEFAULT NULL,
"telno_w" VARCHAR(50) NULL DEFAULT NULL,
"fitcomm" TEXT NULL DEFAULT NULL,
"custcomm" TEXT NULL DEFAULT NULL,
"direct" TEXT NULL DEFAULT NULL,
"contact" VARCHAR(50) NULL DEFAULT NULL,
"fittno" VARCHAR(20) NULL DEFAULT NULL,
"finish" VARCHAR(10) NULL DEFAULT NULL,
"totwind" VARCHAR(10) NULL DEFAULT NULL,
"totdoor" VARCHAR(10) NULL DEFAULT NULL,
"totpatio" VARCHAR(10) NULL DEFAULT NULL,
"totboards" VARCHAR(10) NULL DEFAULT NULL,
"totframes" VARCHAR(10) NULL DEFAULT NULL,
"okwind" VARCHAR(10) NULL DEFAULT NULL,
"okdoors" VARCHAR(10) NULL DEFAULT NULL,
"okframes" VARCHAR(10) NULL DEFAULT NULL,
"okpatio" VARCHAR(10) NULL DEFAULT NULL,
"notfitted" VARCHAR(10) NULL DEFAULT NULL,
"delvonly" VARCHAR(10) NULL DEFAULT NULL,
"okunits" VARCHAR(10) NULL DEFAULT NULL,
"okseal" VARCHAR(5) NULL DEFAULT NULL,
"okdeliver" VARCHAR(5) NULL DEFAULT NULL,
"okboards" VARCHAR(5) NULL DEFAULT NULL,
"okdirect" VARCHAR(5) NULL DEFAULT NULL,
"okmeasure" VARCHAR(5) NULL DEFAULT NULL,
"okadvert" VARCHAR(5) NULL DEFAULT NULL,
"chgrep" VARCHAR(5) NULL DEFAULT NULL,
"sercode" VARCHAR(50) NULL DEFAULT NULL,
"prod_week" VARCHAR(10) NULL DEFAULT NULL,
"sername" VARCHAR(50) NULL DEFAULT NULL,
"jobcomp" VARCHAR(10) NULL DEFAULT NULL,
"datecomp" DATETIME NULL DEFAULT NULL,
"north" VARCHAR(10) NULL DEFAULT NULL,
"signature" VARCHAR(10) NULL DEFAULT NULL,
"loadCode" VARCHAR(10) NULL DEFAULT NULL,
"remake" VARCHAR(10) NULL DEFAULT NULL,
"serfollow" VARCHAR(10) NULL DEFAULT NULL,
"externalft" VARCHAR(10) NULL DEFAULT NULL,
"oketc" VARCHAR(10) NULL DEFAULT NULL,
"glassbrk" VARCHAR(10) NULL DEFAULT NULL,
"glassbl" VARCHAR(10) NULL DEFAULT NULL,
"bkpanehigh" VARCHAR(10) NULL DEFAULT NULL,
"datasrc" VARCHAR(50) NULL DEFAULT NULL,
"schdno" VARCHAR(10) NULL DEFAULT NULL,
"formcomp" VARCHAR(50) NULL DEFAULT NULL,
"remakemeas" VARCHAR(50) NULL DEFAULT NULL,
"archive" VARCHAR(5) NULL DEFAULT NULL,
"scode" VARCHAR(50) NULL DEFAULT NULL,
"pcode" VARCHAR(50) NULL DEFAULT NULL,
"acode" VARCHAR(20) NULL DEFAULT NULL,
"acntcode" VARCHAR(20) NULL DEFAULT NULL,
"countryCode" CHAR(2) NULL DEFAULT NULL,
"instanceProcessedId" INT NULL DEFAULT NULL,
"fosId" INT NOT NULL,
"fittStatus" VARCHAR(30) NULL DEFAULT NULL,
UNIQUE INDEX "UNIQUE" ("fosId")
)
;
со следующей строкой (это только 1 вставка из 1000 строк, которые я должен вставить):
INSERT INTO mj.FittingOldSystem(fittingOldSystemId, name, address_1, add_2, add_3, add_4, add_5, county, date, order_no, phone, rep, house_no, fit_date, fitters, type, site_add1, site_add2, site_add3, site_add4, site_add5, fullAddress, cus_comm_1, telno_h, telno_w, fitcomm, custcomm, direct, contact, fittno, finish, totwind, totdoor, totpatio, totboards, totframes, okwind, okdoors, okframes, okpatio, notfitted, delvonly, okunits, okseal, okdeliver, okboards, okdirect, okmeasure, okadvert, chgrep, sercode, prod_week, sername, jobcomp, datecomp, north, signature, loadCode, remake, serfollow, externalft, oketc, glassbrk, glassbl, bkpanehigh, datasrc, schdno, formcomp, remakemeas, archive, scode, pcode, acode, acntcode, countryCode, instanceProcessedId, fosId, fittStatus) VALUES
(2036446,'Newline Homes','Unit 3','Coolmine Centre','Coolmine Ind Est','Dublin 15','NULL','NULL',convert(datetime,'2019-05-07 09:08:56.130000', 121),'6900156','NULL','BF','1718','2019-05-21','D04','N','156','Allendale Strip','Hausfield','Dublin 15','NULL','Unit 3, Coolmine Centre, Coolmine Ind Est, Dublin 15156, Allendale Strip, Hausfield, Dublin 15','NULL','0838979692','NULL','NULL','NULL','N53 23.4000000 W6 25.8270000 ','NULL',2036446,'NULL','NULL','NULL','NULL','NULL','NULL','NULL','NULL','NULL','NULL','NULL','NULL','NULL','NULL','NULL','NULL','NULL','NULL','NULL','NULL','NULL',19,'NULL','NULL','NULL','False','NULL','NULL','NULL','NULL','NULL','NULL','NULL','NULL','NULL','NULL','NULL','NULL','NULL','NULL','NULL','NULL','NULL','NULL','IE','NULL',94394873,'NULL')
Но я продолжаю получать следующий код:
Ошибка преобразования при преобразовании даты и / или времени из символьной строки.
Я пытался использовать [], '', "" для даты столбца и fit_date.Это не сработало.
Также я пытался использовать convert(datetime,'2019-05-07 09:08:56.130000', 121)
.Еще не работает