Alex Gordon
Alex Gordon

Reputation: 60791

sql server 2008: is it possible to specify format instead of using formatfile?

USE AdventureWorks2008R2;
GO
INSERT INTO myTestSkipField 
   SELECT *
      FROM  OPENROWSET(BULK  'C:\myTestSkipField-c.dat',
      FORMATFILE='C:\myTestSkipField.fmt'  
       ) AS t1;
GO 

i dont want to specify a formatfile!!! i just want to specify the format inline. is this possible?

Upvotes: 0

Views: 1089

Answers (1)

littlegreen
littlegreen

Reputation: 7420

It is not possible to specify the format as a parameter to either OPENROWSET or BULK INSERT.

You can however insert the data into a view. IMO this is an elegant solution.

Upvotes: 1

Related Questions