SQL Server INSERT INTO with WHERE clause

后端 未结 7 1144
礼貌的吻别
礼貌的吻别 2021-01-05 05:39

I\'m trying to insert some mock payment info into a dev database with this query:

INSERT
    INTO
        Payments(Amount)
    VALUES(12.33)
WHERE
    Paymen         


        
相关标签:
7条回答
  • 2021-01-05 06:15

    Ok, looks like I actually need to just do an insert into the Payments table that has the correct CustomerID, as there are currently no Payments with that CustomerID, so I cannot update it.

    I ran INSERT INTO Payments (CustomerID, Amount, PaymentTypeID) Values ('145300', 24.99, 8); and then SELECT * FROM Payments WHERE Payments.CustomerID = '145300'; to confirm and we're in business. Thanks everyone!

    0 讨论(0)
提交回复
热议问题