Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
erc
Starting Member
3 Posts |
Posted - 2004-07-21 : 16:58:17
|
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 thatdbo.materials had already exist.what the meaning of that ?can i get my table back ?Please, help me! |
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2004-07-21 : 17:00:45
|
Run this in Query Analyzer:SELECT *FROM dbo.materialsIs 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 |
 |
|
Kristen
Test
22859 Posts |
Posted - 2004-07-21 : 18:54:12
|
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 |
 |
|
eyechart
Master Smack Fu Yak Hacker
3575 Posts |
Posted - 2004-07-21 : 19:40:06
|
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)gocreate view foo as select * from foogocreate procedure foo asbeginselect getdate()endgo 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 |
 |
|
Kristen
Test
22859 Posts |
Posted - 2004-07-21 : 19:43:43
|
(Sorry, got a bit flippent so I removed my post)Kristen |
 |
|
AjarnMark
SQL Slashing Gunting Master
3246 Posts |
Posted - 2004-07-21 : 20:30:01
|
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 |
 |
|
|
|
|