Eddie Eddie - 11 months ago 60
SQL Question

Stored procedure insert into function

I have two tables

  • First table is
    with columns
    CustomerId, CustomerName

  • Second table is
    with columns
    LicenseId, Customer

The column
in the second table is the
from the First table

I wanted to create a stored procedure that insert values into table 2

Insert into Licenses (Customer)

How can I get this data from the other table?

Thanks in advance for any help

Answer Source

this looks to me like simply a syntax question - I think what you want is

INSERT INTO Licenses (Customer) SELECT CustomerId FROM customers where ...