SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Old Forums
 CLOSED - General SQL Server
 Rollback
 Forum Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

erc
Starting Member

Indonesia
3 Posts

Posted - 07/21/2004 :  16:58:17  Show Profile
Ok, i have a big problem here.
can someone help me fast?

i had accidentally drop my table (materials table)
when i tried to make a table with the same name, it's said that
dbo.materials had already exist.

what the meaning of that ?
can i get my table back ?

Please, help me!

tkizer
Almighty SQL Goddess

USA
36685 Posts

Posted - 07/21/2004 :  17:00:45  Show Profile  Visit tkizer's Homepage
Run this in Query Analyzer:

SELECT *
FROM dbo.materials

Is there data returned? If so, the table was not deleted.

Do you have a recent backup? If the table was in fact deleted and you've got no backup, then the only way to get it back is to buy a third party tool that can read the transaction log.

Tara
Go to Top of Page

Kristen
Test

United Kingdom
22403 Posts

Posted - 07/21/2004 :  18:54:12  Show Profile
Might be some other object called materials that exists (e.g. stored procedure)

SELECT name, type FROM sysobjects WHERE name = 'materials'

The "type" will give you a clue as to what type of object it is.

Kristen
Go to Top of Page

eyechart
Flowing Fount of Yak Knowledge

USA
3575 Posts

Posted - 07/21/2004 :  19:40:06  Show Profile
I have never really thought about this too much, but you cannot create a sproc with the same name as a table (or any other object for that matter).

create table foo (bar int)
go

create view foo as select * from foo
go

create procedure foo as
begin
select getdate()
end
go



EDIT:

Even in Oracle you cannot name a sproc the same as a table. I guess we have never run into it because we use so many different Schemas in Oracle. In SQL Server everything is owned by dbo (for the most part). Maybe this will be different in sql 2005...



-ec

Edited by - eyechart on 07/21/2004 20:24:52
Go to Top of Page

Kristen
Test

United Kingdom
22403 Posts

Posted - 07/21/2004 :  19:43:43  Show Profile
(Sorry, got a bit flippent so I removed my post)

Kristen

Edited by - Kristen on 07/21/2004 19:45:07
Go to Top of Page

AjarnMark
SQL Slashing Gunting Master

USA
3246 Posts

Posted - 07/21/2004 :  20:30:01  Show Profile  Visit AjarnMark's Homepage
Is it possible, erc, that you dropped a table named materials that was owned by a user other than dbo?

-----------------------------------------------------
Words of Wisdom from AjarnMark, owner of Infoneering
Go to Top of Page
  Previous Topic Topic Next Topic  
 Forum Locked
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.14 seconds. Powered By: Snitz Forums 2000