Is it possible to use environment variables with the BULK INSERT command? I was really hoping this would 'just work':
BULK INSERT [dbo].[MyTable] FROM '%HOMEDRIVE%\Data\test.txt'
WITH (FIELDTERMINATOR = '\t', ROWTERMINATOR = '\n');
I realize this would be in respect to the server, not the client.
I'm sure I can get it to work with XP_cmdshell
, but that seems excessive.
I'm actually looking to use another environment variable, I just picked %HOMEDRIVE% as a known example.