How do you insert data into a table variable from a flat file?
DECLARE @Format TABLE
(
Field1 VARCHAR(50),
Field2 VARCHAR(50),
Field3 VARCHAR(10)
)
BULK INSERT @Format
(SELECT Field1
,Field2
,Field3
FROM OPENROWSET(BULK 'C:\Test.txt' ,
FORMATFILE='C:\Test.txt') AS Test
WHERE Field1 <> 'N/A')