none
Unresolved reference to CLR UDT type RRS feed

  • Question

  • Hi,

    I've got a problem. In VS 2013 I've created my own UDT type:

    [Serializable]
    [Microsoft.SqlServer.Server.SqlUserDefinedType(Format.UserDefined, IsByteOrdered = true, ValidationMethodName = "ValidateInput", MaxByteSize = 170)]
    public struct Pesel : INullable, IBinarySerialize

    Then I've added a new table query:

    CREATE TABLE [dbo].[Person]
    (
        [Name] TEXT NOT NULL, 
        [Pesel] [dbo].[Pesel] NOT NULL, 
        PRIMARY KEY ([Pesel]) 
    )

    When I try to build my project I get this error:

    SQL71501: Column: [dbo].[Person].[Pesel] has an unresolved reference to Built-in Type [dbo].[Pesel]

    What I'm doing wrong? When I delete create table query, build the project and create new type manually, everything is ok. I can create my table. 

    Thanks in advance for help!

    Sunday, December 14, 2014 12:12 AM

All replies

  • Hello Mozzer39

    Does the build error only happen on the first build? After it builds correctly is the issue resolved or does the build failure repro the next time open Visual Studio?

    Could you also provide the exact set of steps you took to get the build failure? I have tried  creating a project as you described and I don't get the build error. Also, could you please share the version you are using(Help->about->SQL Server Data Tools)?

    Thanks

    Lonny

    Thursday, January 8, 2015 7:48 AM