15,909,953 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
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!