I have a company table and a licence table. I need to insert a new row in the license table for every company in the company table that isn't already in the license table.
License (ID,CompanyID,LicenseStart,LicenseEnd,CreatedDate,AddUser,UpdateUser,UpdateDate,TemplateId)
The ID in this table is incremented by 1 when a new row is added.
Company (ID,Name,CreateDate,CState,LocationID,LegalName)
The default value that would be entered for each CompanyID that isn't already in the license table should look something like this.
Insert (ID, @theCompanyID, GetDate(), DATEADD(day,14,GETDATE()), null,null,null,null null)
@theCompanyID
would be the CompanyID that isn't in the license table
I am very new to this so any help would be appreciated.