Drop failed for DefaultConstraint


Author
Message
ChanKK
ChanKK
StrataFrame User (474 reputation)StrataFrame User (474 reputation)StrataFrame User (474 reputation)StrataFrame User (474 reputation)StrataFrame User (474 reputation)StrataFrame User (474 reputation)StrataFrame User (474 reputation)StrataFrame User (474 reputation)StrataFrame User (474 reputation)
Group: Forum Members
Posts: 190, Visits: 1.3K
Hi,



I have a scenario whereby there is a column slip with data type image which allows null and no default value is set since it allows null.



I deleted the slip column in the ddt and save. Then I create the column slip again with data type nvarchar(256) which does not allow null with default value (‘’) and save.



Then I generate the package and run the package. It tries to drop the column but failed. The reason behind it due to it tries to drop the default constraint for the slip column which does not exist in the first place since it allows null.



I’m attaching the log file as a reference for the given problem.



• 04/03/2009 7:43:12 PM   -> Deploying meta-data for database 'VfsDocumentHope'

• 04/03/2009 7:43:12 PM   -> Ensuring Filegroups exist on database 'VfsDocumentHope'

• 04/03/2009 7:43:12 PM   -> Filegroup verification complete.

• 04/03/2009 7:43:12 PM   -> Ensuring Tables exist on database 'VfsDocumentHope'

• 04/03/2009 7:43:14 PM   -> The table 'LVELeaves' is being prepared to be modified.

X 04/03/2009 7:43:15 PM   -> An error occurred while deploying the meta-data to the server.

X 04/03/2009 7:43:15 PM   -> FailedOperationException

X 04/03/2009 7:43:15 PM   -> Drop failed for DefaultConstraint 'DF_LVELeaves_Slip'.

X 04/03/2009 7:43:15 PM   -> InvalidSmoOperationException

X 04/03/2009 7:43:15 PM   -> You cannot execute this operation since the object has not been created.

X 04/03/2009 7:43:15 PM   ->

X 04/03/2009 7:43:15 PM   -> Source : Microsoft.SqlServer.Smo

X 04/03/2009 7:43:15 PM   ->

X 04/03/2009 7:43:15 PM   -> Stack Trace:

X 04/03/2009 7:43:15 PM   -> at Microsoft.SqlServer.Management.Smo.SqlSmoObject.CheckObjectStateImpl(Boolean throwIfNotCreated)

X 04/03/2009 7:43:15 PM   -> at Microsoft.SqlServer.Management.Smo.SqlSmoObject.CheckObjectState(Boolean throwIfNotCreated)

X 04/03/2009 7:43:15 PM   -> at Microsoft.SqlServer.Management.Smo.SqlSmoObject.DropImplWorker(Urn& urn)

X 04/03/2009 7:43:15 PM   -> at Microsoft.SqlServer.Management.Smo.SqlSmoObject.DropImpl()

X 04/03/2009 7:43:15 PM   -> at Microsoft.SqlServer.Management.Smo.DefaultConstraint.Drop()

X 04/03/2009 7:43:15 PM   -> at MicroFour.StrataFrame.DBEngine.SQL.DatabaseMigrator.PrepareColumnForAlter(Column Col, Boolean DropAllDependencies)

X 04/03/2009 7:43:15 PM   -> at MicroFour.StrataFrame.DBEngine.SQL.DatabaseMigrator.VerifyColumns(Table Tbl, TableInfo TblInfo)

X 04/03/2009 7:43:15 PM   -> at MicroFour.StrataFrame.DBEngine.SQL.DatabaseMigrator.VerifyTable(Table Tbl, TableInfo TblInfo)

X 04/03/2009 7:43:15 PM   -> at MicroFour.StrataFrame.DBEngine.SQL.DatabaseMigrator.EnsureTables(Database TblParent, DatabaseInfo DbInfo)

X 04/03/2009 7:43:15 PM   -> at MicroFour.StrataFrame.DBEngine.SQL.DatabaseMigrator.EnsureDatabases()

X 04/03/2009 7:43:15 PM   -> at MicroFour.StrataFrame.DBEngine.SQL.DatabaseMigrator.DeployMetaDataThread()

X 04/03/2009 7:43:15 PM   ->





Thanks.
Trent Taylor
Trent Taylor
StrataFrame Developer (13K reputation)StrataFrame Developer (13K reputation)StrataFrame Developer (13K reputation)StrataFrame Developer (13K reputation)StrataFrame Developer (13K reputation)StrataFrame Developer (13K reputation)StrataFrame Developer (13K reputation)StrataFrame Developer (13K reputation)StrataFrame Developer (13K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
Have you tried this with the most recent beta?  This has to do with the default value and this logic has been changed to circumvent these types of issues within certain environments.  Download the most recent beta of 1.6.7 and see if this issue still persists.
ChanKK
ChanKK
StrataFrame User (474 reputation)StrataFrame User (474 reputation)StrataFrame User (474 reputation)StrataFrame User (474 reputation)StrataFrame User (474 reputation)StrataFrame User (474 reputation)StrataFrame User (474 reputation)StrataFrame User (474 reputation)StrataFrame User (474 reputation)
Group: Forum Members
Posts: 190, Visits: 1.3K
Hi,

I download 1.6.7 beta and the issue still happen. I would send you my package and database via PM.



Thank you
ChanKK
ChanKK
StrataFrame User (474 reputation)StrataFrame User (474 reputation)StrataFrame User (474 reputation)StrataFrame User (474 reputation)StrataFrame User (474 reputation)StrataFrame User (474 reputation)StrataFrame User (474 reputation)StrataFrame User (474 reputation)StrataFrame User (474 reputation)
Group: Forum Members
Posts: 190, Visits: 1.3K
Hi,

I have sent my package, database, and log via PM 2 days ago. Did you receive it?



Thank you
Trent Taylor
Trent Taylor
StrataFrame Developer (13K reputation)StrataFrame Developer (13K reputation)StrataFrame Developer (13K reputation)StrataFrame Developer (13K reputation)StrataFrame Developer (13K reputation)StrataFrame Developer (13K reputation)StrataFrame Developer (13K reputation)StrataFrame Developer (13K reputation)StrataFrame Developer (13K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
Yes.  But I have not yet had a chance to look at this.  I plan to look at it early this week.  Sorry for the delay, but we have a lot going on at the moment and are working through these in a  "first-in / first-out" manner.  Thanks.
Trent Taylor
Trent Taylor
StrataFrame Developer (13K reputation)StrataFrame Developer (13K reputation)StrataFrame Developer (13K reputation)StrataFrame Developer (13K reputation)StrataFrame Developer (13K reputation)StrataFrame Developer (13K reputation)StrataFrame Developer (13K reputation)StrataFrame Developer (13K reputation)StrataFrame Developer (13K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
I have been messing with this for a while and have found a number of issues.  First, the deployed database and the package have different file group names.  This isn't a big deal, but you may need to account for this if you are going to be deploying in the field on databases that have a file group named "VfsDocument1" when the default file group name will follow the database name because of the $DbName$ parm in the DDT.  By default it will try and name the file group "Vfsdocument."  That is issue 1.  Next, you have a field that has been deleted and then re-added to the database.  So this will present an issue once deployed (the field will be missing and you will actually need it).

Next, you are trying to convert an Image field into an NVarChar (slip).  This will not work either.  If you are going to convert from an Image to an NVarChar, you are going to have to take this into account in a pre-post deployment script as it is unknown what to do with this data.

Once I fixed these errors (I removed the Slip Field) it worked perfectly.


ChanKK
ChanKK
StrataFrame User (474 reputation)StrataFrame User (474 reputation)StrataFrame User (474 reputation)StrataFrame User (474 reputation)StrataFrame User (474 reputation)StrataFrame User (474 reputation)StrataFrame User (474 reputation)StrataFrame User (474 reputation)StrataFrame User (474 reputation)
Group: Forum Members
Posts: 190, Visits: 1.3K
Hi,

Sorry for wasting your time by sent you inaccurate data for this issue. I would prepare another set of pkg for this.



Sorry for any inconvenience.



Thank you
Trent Taylor
Trent Taylor
StrataFrame Developer (13K reputation)StrataFrame Developer (13K reputation)StrataFrame Developer (13K reputation)StrataFrame Developer (13K reputation)StrataFrame Developer (13K reputation)StrataFrame Developer (13K reputation)StrataFrame Developer (13K reputation)StrataFrame Developer (13K reputation)StrataFrame Developer (13K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
Not a problem...it happens.  When you get a chance let me have the other scenario and I will look at it.  Thanks.
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search