Is it possible to store .fmt file right in database like stored procedure, not in separate file?
Imported files varies, format file is constant for the procedure. No BLOBs, no FILESTREAM used.
...
FROM OPENROWSET (
BULK 'd:\path\some_variable_file.txt',
FIRSTROW = 2,
FORMATFILE = 'd:\path\importformat.fmt'
) AS import
OPENROWSET does not support any source besides the file system for FORMATFILEs. One option you could do is store the format file data (in either the non-xml or xml format) in a database and extract it with a powershell script