Search code examples
sql-serversql-server-2012linq-to-sqluser-defined-types

Can not add stored procedures in Linq to SQL file in Visual Web Developer containing User defined table types


I have SQL Server 2012 Database.

There are two SPs one with string type of parameter and other with the user-define type as parameter.

I can pull first SP from Database Explorer in Visual Web developer to Linq to SQL file, but I am not able to pull second SP (one with user-defined type as parameter) to Linq to SQL file.

Also I am unable to see my User-defined types under the 'Types' folder in Database Explorer.

I restarted my system couple of time but did not help and getting error as:

Could not retrieve schema information for database object dbo.JobSaveOrPublishJob

Am I missing anything?.

The schema of second Stored Procedure is:

ALTER PROCEDURE [dbo].[JobSaveOrPublishJob]
    -- Add the parameters for the stored procedure here
    @Title NVARCHAR(150), --
    @WorktoolID INT,
    @JobSummary NVARCHAR(500),--
    @Description NVARCHAR(4000),--
    @StartDate DATETIME,--
    @DueDate DATETIME,--
    @Duration INT,--
    @BasePayment MONEY, --
    @InstanceCount INT, --
    @MarketPlaceID BIGINT, --
    --@PreferredZerkerIDs [dbo].[TableTypePreferredZerkers] READONLY, -- User-defined type
    @PublishAfter int, 
    @Qualifications [dbo].[TableTypeQualificationJob] READONLY, -- User-defined type
    @Questionnaires [dbo].[TableTypeQuestionnaire] READONLY, -- User-defined type
    @AutoAward BIT, --
    @AutoAccept BIT, --
    @SharePublicProfile BIT, --
    @BlockCommunication BIT, --
    @IsPublished BIT, --
    @CreatedBy BIGINT, --
    @TrainingCourse [dbo].[TableTypeJobTrainingCourses] READONLY -- User-defined type

AS
BEGIN
-- Do something

Solution

  • It's not supported from a designer perspective. There is a way to work around it from a code perspective, but it isn't pretty (at all). See

    https://stackoverflow.com/a/1810750/736079