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.

 All Forums
 SQL Server 2008 Forums
 SSIS and Import/Export (2008)
 Object Exists Error when object does not exist

Author  Topic 

Zix
Starting Member

31 Posts

Posted - 2010-01-08 : 09:06:31
Using the Import/Export wizard to pull data from a flat file into a database. When I execute I get teh following error:

"Error: Executing the query "CREATE TABLE [dbo].[SingleFamily]([AMEN]varchar..."failed with the following erorr:"There is already an object named 'SingleFamily' in the database.". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly."

I dropped the SingleFamily table and executed the package again getting the same error.

Not sure where to start. Any ideas?

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2010-01-08 : 09:23:14
Maybe you dropped the table in a wrong database?
OR
If you really where able to drop the table and there was no error by dropping (error: table doesn't exist...) then ok
otherwise it is possible that there is another object with that name. It can be a view for example...


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

Zix
Starting Member

31 Posts

Posted - 2010-01-08 : 09:43:23
Anything is possible webfred.

Note that this is a brand new install. All I have done with it is run 12 create table scripts.
Go to Top of Page

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2010-01-08 : 09:49:42
Aha - so there cannot be another object with same name.
And you are sure the package has the connection to server and database as you think.

When stepping through the wizard there is a setting that you can check and it is named like 'drop existing table' or so...
I don't remember the screen ...hm... was it 'Edit mappings'?


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

Zix
Starting Member

31 Posts

Posted - 2010-01-08 : 10:15:30
Not sure about the connection to the database and server no. Not sure how to check that.

I remember the field you are talking about. Cant remember what screen but will check. Not sure how that would affect this. Would make sense that if the wizard were putting a "drop first" type of command into the SQL that there would also be an "if exists" type of command as well.
Go to Top of Page

Zix
Starting Member

31 Posts

Posted - 2010-01-08 : 10:18:37
Another related question.

How long should an import take (I know it depends on tons of factors)? I'm importing data from a flat file into a database table and there are only ~700 records. It has been running for over an hour now and has not completed.

This is a small dev server but it's not doing ANYTHING else except moving this data.

This can't be typical. The production environment is going to be dealing in hundreds of thousands of rows.
Go to Top of Page

russell
Pyro-ma-ni-yak

5072 Posts

Posted - 2010-01-08 : 10:20:49
also make sure you dropped the right table. perhaps you're mapped to a different schema.

try DROP TABLE dbo.SingleFamily
Go to Top of Page

russell
Pyro-ma-ni-yak

5072 Posts

Posted - 2010-01-08 : 10:21:35
sounds like blocking. execute sp_who2 to see what's blocking the import
Go to Top of Page

Zix
Starting Member

31 Posts

Posted - 2010-01-08 : 10:32:58
Ran sp_who2. I see a BlkBy column and all 29 rows have a "." in them. Is that what I should expect?
Go to Top of Page

Zix
Starting Member

31 Posts

Posted - 2010-01-08 : 10:49:39
The relevant rows from sp_who2.

[url]http://squarepegtech.net/client_data/sq_who2.xls[/url]

Doesn't look like anything is being blocked does it?
Go to Top of Page
   

- Advertisement -