Eddie Eddie - 1 year ago 79
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 ...
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download