sql71501 sql parameter has unresolved reference to build-in type Visual Studio 2012 DB project
Asked Answered
A

1

5

I am getting the following error with my database project in VS2012. The problem started when I added a custom type in my Database project in VS2012.

CREATE TYPE [dbo].[DestAttractions] AS TABLE(
[TAAttractionId] [varchar](10) NOT NULL,
[TARatingImgUrl] [varchar](256) NULL,
[TAReviewCount] [int] NULL,
[TAReviewUrl] [varchar](256) NULL)

When I try to reference the type in stored procedure which is also part of the database project

CREATE PROCEDURE [dbo].[spupd_DestinationTripAdvisorData]
@DestinationId INT,
@TAAwardImgUrl VARCHAR(256),
@Attractions dbo.DestAttractions READONLY
AS
BEGIN

------
------
END

And build the database project I keep on getting the following error which is quite annoying since the stored procedure works flawlessly and there is no problem with the type.

SQL71501: Parameter: [dbo].[spupd_DestinationTripAdvisorData].[@Attractions] has an unresolved reference to Built-in Type [dbo].[DestAttractions]. Any pointers or help will be much appreciated.

Aeolian answered 23/2, 2015 at 16:28 Comment(3)
Try rebuilding the project, or try again after closing VS and reopening it. I've seen this behavior before with custom types and never quite understood why it happens.Eichhorn
Also check the custom type's file properties in VS and make sure Build Action is set to Build.Eichhorn
Thanks Keith. That worked like a charm. Can't believe I missed the build action for the type's file properties.Aeolian
P
12

In my case the solution was to change the Build Action of file what contains the type definition to Build.

Plumule answered 20/6, 2017 at 12:43 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.