|
Author Message Rajib Bahar Group: Members Posts: 8 Joined: 2008-01-08 Profile Posted:2008-02-08 09:42:20
I have set up a linked server called QUICKBOOKS_DATA. What is wrong with the query below? The error is complaining about a field that is not allowed in an insert. I do not know which field is/are disallowed during insertion. Thanks in advance for the help.
------------------- INSERT INTO QUICKBOOKS_DATA...TimeTracking (TxnID, TimeCreated, TimeModified, TxnNumber, TxnDate, TxnDateMacro, EntityRefListID, EntityRefFullName, CustomerRefListID, CustomerRefFullName, ItemServiceRefListID, ItemServiceRefFullName, DurationMinutes, ClassRefListID, ClassRefFullName, BillableStatus ) SELECT '0000000', getdate(), getdate(), '12345', '2/2/2008', getdate(), '80000182-1197387266', 'Rajib Bahar', '80000172-1195590502', 'Proj00:Proj03', '8000006E-1197387831', 'Employee Consulting:Rajib Bahar', 600, '30000-1148588106', 'Minneapolis:MSP - Consultant', 'Billable' -------- Rajib Bahar http://www.rajib-bahar.com http://www.icsql.com http://www.youtube.com/icsql Tom Group:Administrator Posts:5510 Joined:2006-02-17 Profile Posted:2008-02-08 10:07:02
First of all, not all columns in any QODBC table are insertable. Several columns are automatically maintained by QuickBooks and are READ-ONLY. For the schema rules for any QODBC table, do:
sp_columns Tablename

There's also formatting required for dates.
Please see: How are dates formatted in SQL queries when using the QuickBooks generated time stamps? How do I do INSERTs, UPDATEs and DELETEs using OPENQUERY with Linked MS SQL Servers? How do I insert data into the Timetracking table? for more information.
Rajib Bahar Group: Members Posts: 8 Joined: 2008-01-08 Profile Posted:2008-02-08 10:17:25
Thanks. This post helped me resolve the issue. Rajib Bahar http://www.rajib-bahar.com http://www.icsql.com http://www.youtube.com/icsql
post_id 2170 forum522c.html Link to Original Article
|