Search code examples
sql-servercreate-table

Cannot find data type dbo.DBFLT8 error - Generated script from one server to another


When I generated a script of one database from one server and I tried to create that database in another server but it showing the error 'Cannot find data type dbo.DBFLT8'. I searched a lot in Google but not able to fix this issue. How to fix this issue?

CREATE TABLE [dbo].[AWControl](
    [LastRetrievalTime] [datetime] NULL,
    [LastRetrievalKey] [dbo].[DBFLT8] NOT NULL,
    [ControllerConfigChangeTime] [datetime] NULL,
    [ControllerConfigChangeKey] [dbo].[DBFLT8] NOT NULL,
    [ConfigChangedBySystemName] [dbo].[VNAME32] NULL,
    [ConfigChangedByUserName] [varchar](64) NULL,
    [HDSPropertyEnabled] [dbo].[DBCHAR] NOT NULL,
    [AWType] INT NOT NULL
) 

Solution

  • Looks like the user-defined datatype is missing from your server where you are trying to run the CREATE TABLE script.

    Run the query to confirm - select * from sys.types where name = 'DBFLT8' and is_user_defined = 1 - if this doesn't return any row then while migrating the object scripts you had missed on the datatype.

    So the next step would be generate the script for the datatype from old server and then run the same in new server and then run the CREATE TABLE script. Hope it helps.