title: Inserting values from Table Valued Parameter into a database table
body: <p>How would I insert values from a table valued parameter into a table</p>
  
  <p>as it is right now it doesnt work.</p>
  
  <p>Which is the best way of doing this?</p>
  
  <pre><code>ALTER PROCEDURE [dbo].[SaveDomainObject]
  @Fields dbo.TemplateFieldsAsSqlParameter READONLY
  
  AS
  BEGIN
  INSERT INTO DomainObjectFields
      VALUES (@UniqueKeyDomainObjectField, @Fields.FieldName, @Fields.FieldValue,@DateCreated, @DateUpdated, @Fields.AllowDuplicates)     
  
   END
  </code></pre>
  
  <p>the compiler tells me I need to daclere the Scalar variable @Fields.</p>
  
  <p>How would I dothis?</p>
  
  <p>kind regards</p>