Friday, February 24, 2012

data types conflict, but I know they dont

Please save my sanity. Here's what I'm doing:

INSERT INTO qtQuote (qtRev, qtQN, qtQuoteNum, qtDate, qtCustID, qtCoID,
qtSalesID, qtInvoice, qtFile, qtPN, qtToolref, qtStenref, qtDueD,
qtDueT, qtDelD, qtChxA, qtChxB, qtFloppy, qtChxC, qtChxD, qtOther,
qtStatus, qtType, qtWdth, qtLgth, qtMat, qtTypeO, qtMat1, qtMat1C,
qtMat2, qtMat2C, qtMat3, qtMat3C, qtClmps, qtClip, qtPins, qtHold,
qtSky, qtRot, qtCust1, qtCust1C, qtUnit, qtProgH, qtProgM, qtMCH,
qtMCM, qtMCC, qtAssH, qtAssM, qtAssC, qtOthH, qtOthM, qtOthC, qtPrem,
qtDisc, qtNotes) VALUES ('', '222q0005', '5', getdate(), '3', '222',
'1', '', '', '', '', '', '', '', '1', '', 'wwww', '', '', 'some crazy text',
'1', '', '3', '54', '54', '59.00', '', '', '$0.00', '', '$0.00', '',
'$0.00', '0', '0', '0', '0', '0', '0', '0', '$0.00', '1', '0', '0',
'0', '0', '$60.00', '0', '0', '$60.00', '0', '0', '$0.00', '0', '0',
'');

but then I get this error:

Server: Msg 245, Level 16, State 1, Line 1
Syntax error converting the varchar value 'some crazy text' to a column of data type bit.

but I KNOW qtOther (and qtFloppy, which this also happens to) are varchar types... why is it telling me they are not??!?

using SQL Server 2000 and I'm a big newbie...

thanks!Originally posted by TurkeyBot
Please save my sanity. Here's what I'm doing:

INSERT INTO qtQuote (qtRev, qtQN, qtQuoteNum, qtDate, qtCustID, qtCoID,
qtSalesID, qtInvoice, qtFile, qtPN, qtToolref, qtStenref, qtDueD,
qtDueT, qtDelD, qtChxA, qtChxB, qtFloppy, qtChxC, qtChxD, qtOther,
qtStatus, qtType, qtWdth, qtLgth, qtMat, qtTypeO, qtMat1, qtMat1C,
qtMat2, qtMat2C, qtMat3, qtMat3C, qtClmps, qtClip, qtPins, qtHold,
qtSky, qtRot, qtCust1, qtCust1C, qtUnit, qtProgH, qtProgM, qtMCH,
qtMCM, qtMCC, qtAssH, qtAssM, qtAssC, qtOthH, qtOthM, qtOthC, qtPrem,
qtDisc, qtNotes) VALUES ('', '222q0005', '5', getdate(), '3', '222',
'1', '', '', '', '', '', '', '', '1', '', 'wwww', '', '', 'some crazy text',
'1', '', '3', '54', '54', '59.00', '', '', '$0.00', '', '$0.00', '',
'$0.00', '0', '0', '0', '0', '0', '0', '0', '$0.00', '1', '0', '0',
'0', '0', '$60.00', '0', '0', '$60.00', '0', '0', '$0.00', '0', '0',
'');

but then I get this error:

Server: Msg 245, Level 16, State 1, Line 1
Syntax error converting the varchar value 'some crazy text' to a column of data type bit.

but I KNOW qtOther (and qtFloppy, which this also happens to) are varchar types... why is it telling me they are not??!?

using SQL Server 2000 and I'm a big newbie...

thanks!

can u post the ddl for the table ? so that we will be able to help u|||'some crazy text' is the 20th value in your select list. The 20th value in your insert list is qtChxD. qtOther is the 21st value in your insert list.
Is qtChxD a bit value?|||Thanks Blindman, that was part of the problem. It ended up having to do with the order of the columns in the Function I set up. Even though I checked them at least a half-dozen times, it's always to have another pair of eyes...|||Asking the blindman for another pair of eyes...you can cut the irony with a knife.

No comments:

Post a Comment