Insert missing records from one table to another SQL - stored procedure -


new sql developing & stored procedures. have source table , target table b. need insert table a's data table b making changes.

if source table doesn't have record 1 gl_period column each customer code, insert table b gl_period = 1 missing customer code along other records.

from below image gl_period of ametow doesn't have record gl_record = 1 , attser has gl_record = 1.

i need insert data table b records doesn't have gl_period = 1 ametow (and others) insert other records has gl_period 2,3,4 etc.

table b output should

ametow, americantower, null, 1, null, null, null,0,0,0,0,0 ametow, americantower, null, 2, null, null, null,0,0,0,0,0 ametow, americantower, null, 3, null, null, null,0,0,0,0,0 ametow, americantower, null, 4, null, null, null,0,0,0,0,0 

thanks in advance, please let me know if need more details.


Comments

Popular posts from this blog

basic authentication with http post params android -

vb.net - Virtual Keyboard commands -

How to get multiresult with multicondition in Sql Server -