DTS Package With xp_cmdshell -
07-19-2006
, 02:37 PM
All
Importing an Excel spreadsheet into a table using a DTS package that is
executed using the xp_cmdshell command.
The spreadsheet is located on a shared drive and the first row is the
column names.
The DTS package drops the existing table then re-creates it then
imports the spreadsheet.
This package runs fine if I run it from Enterprise Manager but it
leaves some columns NULL if it's run using the xp_cmdshell command in
SQL Server Agent.
EXEC master..xp_cmdshell 'dtsrun /Sservername /E /NExcelInsert'
Not sure why this is happening. It seems if the first record contains a
NULL value then the remaining rows will import with NULLs.
Thanks Mike |