• adonetok - Wednesday, February 14, 2018 8:59 AM

    I learn how to pass datatable (created from app) to stored procedure from here.
    https://technet.microsoft.com/en-us/library/bb522526(v=sql.105).aspx

    USE AdventureWorks2008R2;
    GO
    /* Create a user-defined table type */
    CREATE TYPE LocationTableType AS TABLE (
    LocationName VARCHAR(50),
    CostRate INT );
    GO

    Question:
    Since datatable is created from a Excel file in which there are about 100 columns.
    Do I need to define all columns in user-defined table? 

    I'm afraid, yes, if you want to pass user defined table type to stored procedure.

    GASQL.com - Focus on Database and Cloud