Help from experienced Guru with the temp table

  • so why not do SELECT * INTO #TEMPGE_ReservesFile FROM GE_ReservesFile.then change the name in your update statments to the temp table just created: #TEMPGE_ReservesFile

    why do you want to do it to a temp table instead? the above idea would work, but  if the original table is huge, your tempdb is gonna grow just as large. might not be the best solution.

     

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • i cannot use or in otherwords dont have access to that table GE_ReserveFile any more so can you show me how to deal with the situation.

  • Update r --GE_ReservesFile

    Set ClaimNumber = c.ClaimNumber,

    LastName = c.LastName,

    FirstName = c.FirstName,

    LossDate = c.LossDate,

    InClaimFile = 1

    From GE_Claim c

       Inner Join GE_ReservesFile r ...

    Utherwise you update not the same instance of the table!

    _____________
    Code for TallyGenerator

  •  i undertand exactly what are you saying but just need to ask you

    which table i have to do the inner join ? because i cannot make inner join on GE_ReservesFile as i told you earlier. 

    Update r --GE_ReservesFile

    Set ClaimNumber = c.ClaimNumber,

    LastName = c.LastName,

    FirstName = c.FirstName,

    LossDate = c.LossDate,

    InClaimFile = 1

    From GE_Claim c

       Inner Join GE_ReservesFile r ...

    Utherwise you update not the same instance of the table!

  • if you do not have SELECT privileges to the table, you cannot get the data into a temp table for manipulation.  there is no work around.

    if you only have SELECT Priviledges, than you can do something with the temp table that some are suggesting.

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • If you cannot make inner join to the table where all your data stored then what do you want to work with?

    _____________
    Code for TallyGenerator

  • instead of making an inner join on table GE_ReserveFile can i create a temp table with the same columns as that of GE_Reservefile and populate it and then i can do the inner join on that temp table what i mean is like this

    first i create temp table and then populate it and then do the update

    Update r

    Set ClaimNumber = c.ClaimNumber,

    LastName = c.LastName,

    FirstName = c.FirstName,

    LossDate = c.LossDate,

    InClaimFile = 1

    From GE_Claim c

       Inner Join  r ...

     

  • Populate it with what?

    _____________
    Code for TallyGenerator

Viewing 8 posts - 1 through 9 (of 9 total)

You must be logged in to reply to this topic. Login to reply