Home > Ask the SQL Server Experts > Tony Bain Questions & Answers > Often used SP wiped out the database
Ask The SQL Server Expert: Questions & Answers
EMAIL THIS

Often used SP wiped out the database

Tony Bain EXPERT RESPONSE FROM: Tony Bain

Pose a Question
Other SQL Server Categories
Meet all SQL Server Experts
Become an Expert for this site


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


>
QUESTION POSED ON: 23 January 2004
We have a stored procedure that we run on our MS Transact databases. The stored procedure simply allows us to run dbcc on all the tables at one time, giving an output that lists each table and the percentage of fragmentation. One of our customers called in yesterday complaining of slow response from the SQL Server. We ran exec sp_showtablefragmentation (our stored procedure) and the results showed one line, "dbcc execution completed..etc..contact your system administrator" When we attempted to access our core tables we realized all our information was gone. Table by table we searched, but the database was gone. The system indexes were still intact. We were able to restore from backup but am very concerned as we use this stored procedure often and have never had this occur.

>

Your stored procedure may or may not be the problem, I cannot say for sure without seeing your code. However if you are sure that the only command you are issuing with this proc is DBCC SHOWCONTIG then it is probably not the cause of your tables disappearing. My money would be on either your database had suffered some sort of corruption, which would have shown up using DBCC CHECKDB or someone (or something) other than this procedure had dropped your tables.

Check SQL Servers error log as there may be some clues here. If not then we'll never know, unless it happens again, but if you want to post the code of your SP then I will have a look at this also.

For More Information


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   



RELATED CONTENT
Tony Bain
Application not resolving username and password
Problems trying to install SQL Server on a two-node cluster on SAN
Error connecting to Web-based application
Conversion of char datatype to datetime datatype resulted in an out of range datetime value
Getting error when dropping, inserting into or truncating table with QA
Tony's SQL Server book for DBAs
Finding gaps in column of sequential numbers
Exporting T-SQL scripts from command line
Oracle SQL doesn't work in SQL Server
Recovering the database from the MDF file

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary



Search and Browse the Expert Answer Center
Search and browse more than 25,000 question and answer pairs from more than 250 TechTarget industry experts.
Browse our Expert Advice



SQL Solutions - SQL Database Design
HomeNewsTopicsITKnowledge ExchangeTipsAsk the ExpertsMultimediaWhite PapersIT Downloads
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 2005 - 2009, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts