Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 SQL CRUD help

Author  Topic 

Zmeat
Starting Member

7 Posts

Posted - 2013-03-12 : 19:46:47
Post can be deleted! :-)

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2013-03-13 : 00:21:30
quote:
Originally posted by Zmeat

SalesOrderID not SalesOrderDetail....i think ive been at my computer too long..


It should be an insert as you need a new record to represent each new item added to cart.
so it would be like

INSERT INTO SalesLT.SalesOrderDetail(SalesOrderID, OrderQty, ProductID, UnitPrice, UnitPriceDiscount)
SELECT 71949, 2, ProductID, ListPrice, .1
FROM SalesLT.Product
WHERE Name LIKE 'Water Bottle%'


------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2013-03-13 : 00:52:37
quote:
Originally posted by Zmeat

Id like to set variables for the id of the CustomerID and for the SaleOrderID but not 100% sure the right syntax for it. Going to be my next step.


do you mean variables for passing values? they're called parameters

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2013-03-13 : 00:53:52
quote:
Originally posted by Zmeat

Post can be deleted! :-)


Please dont remove questions once you get answer. Somebody will benefit out of this discussion at a later point. removing question will not help them to understand what scenario was

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -