2 Replies - 1196 Views - Last Post: 18 May 2012 - 11:43 AM

#1 DarenR  Icon User is offline

  • D.I.C Lover

Reputation: 592
  • View blog
  • Posts: 3,823
  • Joined: 12-January 10

insert into table error

Posted 18 May 2012 - 11:21 AM

I am trying to update an existing table from various other tables and I keep getting the following error:


Msg 8101, Level 16, State 1, Line 8
An explicit value for the identity column in table 't_Business_Vendor_Department_Detail' can only be specified when a column list is used and IDENTITY_INSERT is ON.





		insert into t_Business_Vendor_Department_Detail 
SELECT     '', 34, t_Vendor_Department.vendor_department_id,  t_Business_Vendor.business_Vendor_ID, 120768,getdate(),getdate()  
                      
                   
FROM         t_Vendor_Employee_Detail INNER JOIN
                      t_Vendor_Employee ON t_Vendor_Employee_Detail.Vendor_Employee_ID = t_Vendor_Employee.vendor_employee_id INNER JOIN
                      t_Business_Vendor ON t_Vendor_Employee.Vendor_ID = t_Business_Vendor.Vendor_ID INNER JOIN
                      t_Vendor_Department ON t_Business_Vendor.Vendor_ID = t_Vendor_Department.Vendor_ID INNER JOIN
                      t_Vendor_Class_Detail ON t_Vendor_Department.vendor_class_ID = t_Vendor_Class_Detail.Vendor_Class_ID
WHERE     (t_Vendor_Employee_Detail.txt_Vendor_Employee_Detail_Value = 'yes') AND (t_Vendor_Employee_Detail.Vendor_Detail_Element_ID = 74) AND 
                      (t_Vendor_Class_Detail.Vendor_Class_Detail_ID = 34)and t_Business_Vendor.business_Vendor_ID= 132196



i am very tired right now and cant think straight.


Thanks in advance

Is This A Good Question/Topic? 0
  • +

Replies To: insert into table error

#2 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 13492
  • View blog
  • Posts: 53,895
  • Joined: 12-June 08

Re: insert into table error

Posted 18 May 2012 - 11:25 AM

Are you updating an existing row or inserting a new one?
Was This Post Helpful? 0
  • +
  • -

#3 DarenR  Icon User is offline

  • D.I.C Lover

Reputation: 592
  • View blog
  • Posts: 3,823
  • Joined: 12-January 10

Re: insert into table error

Posted 18 May 2012 - 11:43 AM

I was inserting one... found my error

I had

SELECT     '', 34, t_Vendor_Department.vendor_department_id,  t_Business_Vendor.business_Vendor_ID, 120768,getdate(),getdate()  


should be

SELECT      34, t_Vendor_Department.vendor_department_id,  t_Business_Vendor.business_Vendor_ID, 120768,getdate(),getdate() 


Thanks for quick response modi
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1