Click here to Skip to main content
15,909,953 members

Comments by Member 13542464 (Top 5 by date)

Member 13542464 26-Nov-17 21:54pm View    
Ross see below Code: Everything is fine. But is is inserting values two times instead of 1. What could be reason ? I would like to clear that a table is my Product1 table, c IS my VENDOR table and AC is my Bridge table

DDeclare @name1 varchar(30) = 'bLACK HAT'
Declare @description1 varchar(255) = 'sKKK'
Declare @C_id INT = 1
Declare @Cost1 int = 55
DECLARE @A_id INT
UPDATE PRODUCT1 SET ProductDescription=@description1 WHERE ProductName = @name1
Select @A_id = Productid from PRODUCT1 where ProductName = @name1
Insert into VendorProduct(cost, ProductID, VendorID) values(@Cost1, @A_id, @C_id)
Member 13542464 26-Nov-17 21:29pm View    
Ross Thanks for the effort. Good news is values are inserting in Table A that is A_NAME and A_description. However. it is not inserting in AC table where I need to insert my Cost and a_id. Please see above code titled "New Updated Code"
Member 13542464 26-Nov-17 20:49pm View    
AC is bridge table between A and C. SO A contains product info. C contains vendor info who sells products and AC act as bridge which include cost of the product (sold by vendors that are in c)
Member 13542464 26-Nov-17 20:21pm View    
Thanks Ross Please see my updated question for more info.
Thanks in advance!
Member 13542464 26-Nov-17 19:55pm View    
Hi I tried above code . The first time it executed it affected 3 rows, when i tried second time it says "The procedure attempted to return a status of NULL, which is not allowed. A status of 0 will be returned instead". What could be the issue ?
Thanks in advance!