I have a BULK INSERT sql file that executes serveral stored procedures. The file is a CSV and all I need are three columns out of 15 that are inside this file.
How do I specify the three columns in the CSV file using the BULK INSERT t-sql?
Here is one of my scripts:
CREATE PROCEDURE ComputedAttributesLoad
(
@FilePathName varchar(100)
)
AS
TRUNCATE TABLE ComputedAttributes
DECLARE @sql varchar(1000)
BEGIN
SET @sql = "BULK INSERT ComputedAttributes FROM '" +@FilePathName+ "' WITH (FIELDTERMINATOR = ',')"
END
EXEC(@SQL)
GO
Thanks in advance,
Harry