February 14, 2018 at 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?
February 14, 2018 at 10:54 am
No, you could create a staging table by using the import wizard, save the package to the file system tweak as necessary in SSDT to insert or update the columns you care about in the target table.
February 18, 2018 at 11:17 pm
adonetok - Wednesday, February 14, 2018 8:59 AMI learn how to pass datatable (created from app) to stored procedure from here.
https://technet.microsoft.com/en-us/library/bb522526(v=sql.105).aspxUSE AdventureWorks2008R2;
GO
/* Create a user-defined table type */
CREATE TYPE LocationTableType AS TABLE (
LocationName VARCHAR(50),
CostRate INT );
GOQuestion:
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
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply