• prasadau2006 (1/28/2015)


    Hello Friends,

    I need help with the following query, this query is taking more than 20mins to complete. I'm using a left join to

    pull the data.

    Query:

    Insert into dbo.SecondTable

    Select b.* From dbo.FirstTable a Left Join dbo.SecondTable b on a.Id=b.Id where b.Id is null

    it inserts approximately 1.5million records.

    Thanks for your help in advance

    The SELECT query will return NULLs in every column – it is selecting all the rows in 'a' which have no matching row in 'b' and returning only the (NULL) values from table 'b'.

    If you haven't even tried to resolve your issue, please don't expect the hard-working volunteers here to waste their time providing links to answers which you could easily have found yourself.