Schema Refresh Type Definition Changed

Posts   
 
    
psandler
User
Posts: 540
Joined: 22-Feb-2005
# Posted on: 28-Nov-2006 16:31:36   

Version 2, October 23rd build

This might not be a problem, but I wanted to ask the question here before I regenerate the code.

Dev database: SQL 2000 on a SQL 2000 box Staging Box: SQL 2000 on a **SQL 2005 **box

When I change the catalog in the designer to the staging database and refresh, I get a lot of messages like this:

Type definition of field 'UpdatedDate' changed.

It seems to be only date and bit columns. SQL Compare shows no differences between the two models.

Will regenerating the code change anything?

Thanks,

Phil

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 28-Nov-2006 16:44:36   

Interesting... I foresee no problems, but I'll see if I can track down why the fields are marked as changed... It could be default constraints. Do you have default constraints defined on sqlserver 2005?

Frans Bouma | Lead developer LLBLGen Pro
psandler
User
Posts: 540
Joined: 22-Feb-2005
# Posted on: 28-Nov-2006 16:55:13   

Otis wrote:

Interesting... I foresee no problems, but I'll see if I can track down why the fields are marked as changed... It could be default constraints. Do you have default constraints defined on sqlserver 2005?

I just spot-checked about 10 columns, and all of them have default constraints. The defaults exist (and are the same) in both stage and dev.

Thanks,

Phil

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 28-Nov-2006 17:48:11   

Ok, thanks so as they're the same that shouldn't be it. Will check it out why a change is seen, but as I said earlier, I don't expect any issues.

Frans Bouma | Lead developer LLBLGen Pro
Barry
User
Posts: 232
Joined: 17-Aug-2005
# Posted on: 29-Nov-2006 03:16:14   

I also experience the same issue, I've a database which is backup from sql 2000, then I restore it on a sql 2005 and I refresh llblgen project, it prompt for type changed for all datetime field.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 29-Nov-2006 10:24:52   

Reproduced. Looking into it.

(edit) precision, scale and length are 0 on sqlserver2005. I'll check what the cause of that is.

Frans Bouma | Lead developer LLBLGen Pro
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 29-Nov-2006 11:18:19   

The cause is that INFORMATION_SCHEMA.COLUMNS on Sqlserver 2000 reports a value for PRECISION and SCALE, while on sqlserver 2005 it doesn't (NULL).

To see this, try this query:


DECLARE @sFullTableName varchar(100),
@sTableName varchar(100)

SET @sFullTableName = '[dbo].[employees]'
SET @sTableName = 'employees'

SELECT  INFORMATION_SCHEMA.COLUMNS.*,  
    (
        SELECT COLUMNPROPERTY(OBJECT_ID(@sFullTableName), INFORMATION_SCHEMA.COLUMNS.COLUMN_NAME, 'IsComputed')
    ) AS IsComputed, 
    (
        SELECT COLUMNPROPERTY(OBJECT_ID(@sFullTableName), INFORMATION_SCHEMA.COLUMNS.COLUMN_NAME, 'IsIdentity')
    ) AS IsIdentity,
    (
        SELECT COLUMNPROPERTY(OBJECT_ID(@sFullTableName), INFORMATION_SCHEMA.COLUMNS.COLUMN_NAME, 'IsRowGuidCol')
    ) AS IsRowGuidColumn,
    (
        SELECT COLUMNPROPERTY(OBJECT_ID(@sFullTableName), INFORMATION_SCHEMA.COLUMNS.COLUMN_NAME, 'Precision')
    ) AS Length
 FROM       INFORMATION_SCHEMA.COLUMNS 
 WHERE  INFORMATION_SCHEMA.COLUMNS.TABLE_NAME=@sTableName 
            AND INFORMATION_SCHEMA.COLUMNS.TABLE_SCHEMA='dbo'
 ORDER BY INFORMATION_SCHEMA.COLUMNS.ORDINAL_POSITION ASC

and alter the table name at the top.

Frans Bouma | Lead developer LLBLGen Pro