insert into

  • Hi Every body

    insert into eventstatus_bek_IGA1

    (event_call_letter ,

    event_call_address,

    Day_D,

    Month_M,

    Year_Y,

    End_Time ,

    Start_Time ,

    Total_Time )

    select event_call_letter,event_ip_address,day(event_date)as Day_D,month(event_date)as Month_M,Year(event_date)as Year_Y,

    max(event_date)as End_Time,min(event_date)as Start_Time,

    max(event_date)-min(event_date) as Total_time

    from eventstatus_bek_IGA where event_call_letter <> 'NULL'

    group by event_call_letter,event_ip_address,month(event_date),Year(event_date),day(event_date)

    having (max(event_date)-min(event_date)) > '1900-01-01 00:00:00.000'

    I am getting below error could any body correct me

    'Msg 208, Level 16, State 1, Line 1

    Invalid object name 'eventstatus_bek_IGA'

  • Are you running this in the "right" database ?


    * Noel

  • yes i am running right db only

  • The query expects eventstatus_bek_IGA to already exist. Does the table exist?



    Alvin Ramard
    Memphis PASS Chapter[/url]

    All my SSC forum answers come with a money back guarantee. If you didn't like the answer then I'll gladly refund what you paid for it.

    For best practices on asking questions, please read the following article: Forum Etiquette: How to post data/code on a forum to get the best help[/url]

  • - which schema do you expect your object eventstatus_bek_IGA to belong to ?

    - do you have the needed grants to be able to insert into that object ?

    Johan

    Learn to play, play to learn !

    Dont drive faster than your guardian angel can fly ...
    but keeping both feet on the ground wont get you anywhere :w00t:

    - How to post Performance Problems
    - How to post data/code to get the best help[/url]

    - How to prevent a sore throat after hours of presenting ppt

    press F1 for solution, press shift+F1 for urgent solution 😀

    Need a bit of Powershell? How about this

    Who am I ? Sometimes this is me but most of the time this is me

  • One more question, are you trying to use INSERT INTO to create a table, rather than load an existing table??

    INSERT INTO foo

    SELECT...

    FROM

    does not do the same thing as

    SELECT ...

    INTO newFoo

    FROM

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

Viewing 6 posts - 1 through 5 (of 5 total)

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