Table is dropped automatically after creation in SP - Very Strange Behaviour

  • I have one table lets say Table1 which contain 10 million records . With this table I am creating a table TABLE2 with some columns.(select A1,A2,A3,A4,A5 into table2 from table1) . These table has a partition column.

    I am adding a column ID which is an Identity column in table2

    I am making Column ID as clustered key.

    There are 3 update statements running in Table2. Each update will process 100000 records at a time(loop).

    After this I am creating a view from Table1

    creating view vw_table1 from table1 where A1 = ''

    I am getting an error saying that Table1 is is missing.After few minutes table2 is also missing. This is a very strange behaviour.

    Database : Simple recovery model

    Any idea why this happens?

  • can you post the script?

    Are these fully materialized tables in the proc and not temp tables?

    Could this proc be called from multiple sources at the same time?

    Jason...AKA CirqueDeSQLeil
    _______________________________________________
    I have given a name to my pain...MCM SQL Server, MVP
    SQL RNNR
    Posting Performance Based Questions - Gail Shaw[/url]
    Learn Extended Events

  • Yes...It is all physical tables. No temporary tables....

  • Is the proc being called simultaneously? Can multiple connections call this proc at the same time?

    Jason...AKA CirqueDeSQLeil
    _______________________________________________
    I have given a name to my pain...MCM SQL Server, MVP
    SQL RNNR
    Posting Performance Based Questions - Gail Shaw[/url]
    Learn Extended Events

  • No...it is not happening. I ran the procedure 2 times...same error I am getting.

  • @varun: To avoid series of questions, please post your script here.

  • Dev (12/20/2011)


    @Varun: To avoid series of questions, please post your script here.

    Best that can be done at this juncture.

    Jason...AKA CirqueDeSQLeil
    _______________________________________________
    I have given a name to my pain...MCM SQL Server, MVP
    SQL RNNR
    Posting Performance Based Questions - Gail Shaw[/url]
    Learn Extended Events

  • @dev : I am restricted to post the code...sorry...

  • Varun R (12/21/2011)


    @Dev : I am restricted to post the code...sorry...

    Pseudo code is also fine. Rename your table / column names in the script and share it with us. Otherwise it would be very difficult for us to guess what you are actually doing.

  • This was removed by the editor as SPAM

  • As you mention in your post that you selected some columns for table2 from table1. After reading your post it seems that your table1 get corrupted. Some columns of table2 are taken from table1 that’s why table2 is also not showing the value.

    And how did you reach to this conclusion?

    My first doubt is on bad coding, that’s why Table1 become nonexistent when been referred next time.

  • Dev (12/22/2011)


    As you mention in your post that you selected some columns for table2 from table1. After reading your post it seems that your table1 get corrupted. Some columns of table2 are taken from table1 that’s why table2 is also not showing the value.

    And how did you reach to this conclusion?

    My first doubt is on bad coding, that’s why Table1 become nonexistent when been referred next time.

    You're right Dev - this guy appears here now and again to flog data recovery software that miraculously solves this type of "corruption"

  • I found the issue, Some one from onsite has been calling the SP simultaneously.Thanks all for your Great replies...

Viewing 13 posts - 1 through 12 (of 12 total)

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