Invalid object name error ?

jh357jh357 Posts: 2
edited August 4, 2005 1:42PM in SQL Packager Previous Versions
I used packager 1.1.2.5 to package a production database (SQL 2000).
The .net exe gets created and I execute it to create the database on a local dev box.

Packager gives an error stating that one of the stored procs have an 'invalid object name'. Of course the name is valid, why would I get this error. :shock:

Comments

  • Brian DonahueBrian Donahue Posts: 6,590 Bronze 1
    Hello there,

    This can happen due to object ownership. Because if you create objects such as stored procedures without qualifying them with an owner, letting SQL Server assign an owner, you may end up with different ownership on the target database when you run the package.

    For example, you have a stored procedure: CREATE PROC MyProc. You'd created this on the source while logged in as DBO, therefore, SQL Server assigns DBO as the owner. If you then log into the target server using the account Me, which is not a DBO, the stored procedure will be created as Me.MyProc. Any objects that reference this procedure as dbo.MyProc can't be created now, because there is no dbo.MyProc, only Me.MyProc. You will get an invalid object name.

    This is something to be aware of.
This discussion has been closed.