title: Unable to access table variable in stored procedure
body: <p>I  am passing a datatable from Code to stored procedure in this way.</p>
  
  <pre><code>DataTable table = CommonFunctions.ToDataTable(request);
  object[] spParams = new object[1];
  spParams[0] = table;
  
  DbCommand dbCommand = 
    db.GetStoredProcCommand("OS_UpdateOrgStructureDetails", spParams);
  </code></pre>
  
  <p>I am trying to access this parameter in stored proc.</p>
  
  <pre><code>CratePROCEDURE OS_UpdateOrgUnits  
   @table OS_RenameNodeTable READONLY  
  AS  
  BEGIN  
      UPDATE OrgUnit  
      SET DetailName = ut.NewValue  
      FROM @table ut  
      INNER JOIN OrgUnit ou ON ou.OrgUnitID = ut.OrgUnitID  
  END 
  </code></pre>
  
  <p>But when the call is made to stored procedure it throws an error.</p>
  
  <pre><code>The incoming tabular data stream (TDS) remote procedure call (RPC) protocol 
  stream is incorrect. Table-valued parameter 1 ("@table"), row 0, column 0: 
  Data type 0xF3 (user-defined table type) has a non-zero length database name 
  specified.  Database name is not allowed with a table-valued parameter, only 
  schema name and type name are valid.
  </code></pre>
  
  <p>Not able to resolve the error.</p>