4

I have created a Table Value Type, which is created fine.

CREATE TYPE [ContactTemplate] AS TABLE (
    [Email]             VARCHAR(100),
    [FirstName]         VARCHAR(50),
    [LastName]          VARCHAR(50)
)
GO

Then, when i try to create a procedure:

CREATE PROCEDURE [dbo].[usp_ProcessContact]
 (  @Email      VARCHAR(100),
    @FirstName  VARCHAR(50),
    @LastName   VARCHAR(50),
    @Contact    ContactTemplate READONLY)
    as 
    Begin
    -------
    End 

I keep getting error at

@Contact    ContactTemplate READONLY" The parameter @Contact  cannot
be declared READONLY since it is not a table valued parameter

I have tried many things, removing dbo, brackets etc., still cant get it to work. Help please..

4

1 回答 1

12

试试这个:Edit -> IntelliSense -> Refresh Local Cache -- 如果你刚刚定义了表类型,你的符号表还不知道它。或者,创建类型,退出 SSMS,然后重新打开。

于 2013-06-17T20:44:51.290 回答