Group: StrataFrame Users
Posts: 105,
Visits: 641
|
This is not a permissions issue. And again, the PKs indexes are OK and I know about going in and touching these in DDT first, but the default constraint is being created without the DF_tablename as well.
I have a SQL2005 database in development. It matches EXACTLY what I have in DDT (because I imported from it) except for it doesn't have defaults on the non-PK fields. So, in DDT I simply went through and assigned default values. 0 for int, decimal. empty string for varchar, etc.
When I try to deploy back to the same DB that I imported from in development, I get these errors because I have field names that are the same name but in different tables. Maybe this isn't the best design, but these values do represent the same "thing" as far as the application is concerned, so it makes sense to me. Setupkey is a PK on one table but a foreign key in others. But, because of this, the constraint names are not unique - it doesn't matter that they are in different tables. SQL will not allow a constraint to have the same name as another object in the database.
DDT is NOT work like SQL. In SQL Management studio if I put a default value on any of these column it creates the corresponding constraint with DF_tablename_fieldname, thereby making the object name unique across the database. DDT just uses the field name. I don't think I should have to rename my fields just to use DDT. Again, the idea is to not have to touch these local SQL Express databases with scripts, etc. going forward so I'm trying my darndest to get DDT to work for us before this app goes into production.
I would prefer to email you the SQL scripts and DDT package. There are 2 scripts. One to create the DB as we have it deployed in our clients test at the moment, and another to strip the old type of defaults out (we were using the programmable default types before which apparently is not best practice anymore) Then, if you deploy the DDT package I have against this where I have added the literal defaults you will see what I mean. I don't know what else I can do at this point but if we can't resolve this and I have to script stuff still then DDT doesn't seem like it will work for us long term which would be a shame because other than this problem it seems promising that it could really cut down on deployment issues.
|