Posted on 2016-09-09
I have a table with 5 columns. i am trying to insert data into this table, but one column needs a value that is derived from another table and another column needs to have the next highest available interger in that column added.
the 5 columns are
CalculateDateTime (datetime) - value needed is a constant null
AccountStartBalance(interger)- value needed is a constant integer with a value of 0
AccountServiceKey - The value needs to be the next highest available in that column value incremented by the value of 1
ServiceOption(nvarchar) - value needs to be a blank or no value but not null either
Accountkey - This needs to be derived from another table..... Select Accountkey from billingmaster where accountnumber = '999999999'
the result from the last column query would be '11111'
I dont have a clue of how to construct the insert statement but i am guessing it would be.
insert into billingsecondary
values (NULL,0,I need help, I need help, I need help);