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..
Try this: Edit -> IntelliSense -> Refresh Local Cache -- If you just defined the table type, your symbol table doesn't know it yet. Or, create the type, exit from SSMS, and reopen.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With