SQL Scripts - How to run and get results

  • Good Morning,

    I am very new to SQL. I am trying to run a SQL on a table to see what changes were made to the system.

    Can I use one that's on my system in a folder entitled SQL Scripts? or do I need to create one.

    I am using MSSQL Server 2000 and I Query Analyzer and received error message, table already created.

    I am trying to find if any changes were made to the table. In this instance a Table was deleted and need to know who deleted it.

    There is an SQL Files in a Scripts Folder where looks like a query is written that asks it to create a table, but what I am wanting to do is create a log of any changes on that particular table.

    Hope this makes sense.

    Again, thank you for your help and patience with helping me to understand

    How do I get results of the query?

    Thank you for your help.

  • Are you trying to query a table that got dropped?

    By the way, SQL Server does not keeps track of who drops and object but you can be certain was either the owner of the object or somebody with dbo or higher privileges on it.

    _____________________________________
    Pablo (Paul) Berzukov

    Author of Understanding Database Administration available at Amazon and other bookstores.

    Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.
  • In short, no, on SQL 2000 you will not be able to tell if/when/who dropped a table. Your only option is to restore the table from a backup...if such a backup exists.

    On the very off chance you had C2 auditing enabled, or are running a constant trace for auditing pruposes, you may be able to find out. But it's highly unlikely that either is the case.

    /* ----------------------------- */
    Tochter aus Elysium, Wir betreten feuertrunken, Himmlische, dein Heiligtum!

Viewing 3 posts - 1 through 2 (of 2 total)

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